Jump to content


database_connect.php help

  • Please log in to reply
1 reply to this topic

#1 knox

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 July 2006 - 08:26 PM

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

#2 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 17 July 2006 - 01:35 PM

Something like
$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());

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.


Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users