place these statements in your include file, which is standard for PHP

$link=mysql_connect("localhost","user","12345") or die("Error: cannot
mysql_select_db("mydatabase") or die("Error: cannot select db:

-----Original Message-----
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 7:14 AM
Subject: [PHP] Need help

Hello friends.

I am a newbie to php. I am trying to connect to mysql with php.

I have a website called
The mysql database set up by the hosting company is called
I have a table called "addressbook"

I log in into the admin page with my username as "user" and password as
"12345". After that I do not use any username and password. So I am not sure
if I need a username and password in the connection string.

I have this line to connect :
if (!($link=mysql_connect($hostname,$username,$password))){
displayerr(sprintf("internal error %d:%s\n",
                    mysql_errno(), mysql_error()));

What should $hostname, $username and $password be in the globals.php file?

Thanks for help.

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to