Skip to content
WJunction - Webmaster Forum

Replace accounts.php with database

Status
Not open for further replies.
Hi, It's me again B-)

I want to replace the accounts.php file with a database connection. The accounts.php files contains a "PHP Array" which can be replaced by a database/table with the same fields (correct me if I'm wrong):
host (text field)
user (text field)
pass (text field)

The problem is I don't have the knowledge to do this :((

Can anyone help me with this ?
 

3 comments

This is what the accounts.php array looks loke:
PHP:
$premium_acc["megaupload_com"] = array('user' => 'MyPremiumUsername', 'pass' => 'MyPassword');
 
Here is the mysql table create. The unique index will stop you from having the same premium account/user duplicated. But you can have all the unique premium account/user entries you want.
PHP:
CREATE TABLE `PremiumAccounts` (
	`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
	`account` VARCHAR(255) NOT NULL DEFAULT '',
	`user` VARCHAR(255) NULL DEFAULT NULL,
	`password` VARCHAR(255) NOT NULL DEFAULT '',
	PRIMARY KEY (`id`),
	UNIQUE INDEX `accountuser` (`account`, `user`),
	INDEX `account` (`account`),
	INDEX `user` (`user`)
)
ENGINE=MyISAM
ROW_FORMAT=DEFAULT

I would assume the file is an include to a php program you already use then. If you need the code to insert/replace the data let me know.
 
Last edited:
Status
Not open for further replies.

About the author

CuraHack
Banned · Joined
1,007
Messages
221
Reactions
63
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom