place these statements in your include file, which is standard for PHP
development:
$link=mysql_connect("localhost","user","12345") or die("Error: cannot
connect".mysql(error());
mysql_select_db("mydatabase") or die("Error: cannot select db:
".mysql_error());
-----Original Message-----
From: Denis L. Menezes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 7:14 AM
To: [EMAIL PROTECTED]
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 www.abcresources.com
The mysql database set up by the hosting company is called
"abc_resources.com"
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.
Denis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php