Jump to content

Archived

This topic is now archived and is closed to further replies.

knox

database_connect.php help

Recommended Posts

Hi Guys - I do not know very much about PHP and MySQL and I have seem to have a problem.

How am I supposed to create database_connect.php? What has to be inside of it? I'm very confused.

Thank you so much

Share this post


Link to post
Share on other sites
Something like
[code]
$dbc = @ mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die ("Could not connect to mysql:" . mysql_error());
@ mysql_select_db(DB_NAME) or die ("Could not select the database" . mysql_error());
[/code]

where DB_HOST is usually localhost, DB_USER, DB_PASSWORD are the username and password needed to connect, and DB_NAME is the name of your database.

HTH.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.