| Article: |
Using MySQL from PHP | |
| Subject: | Connect to MySQL DB | |
| Date: | 2006-05-09 17:00:30 | |
| From: | Cleo | |
|
I have a hosting account with GODADDY.com where I've been assigned a MySQL database. But I'm having trouble connecting to it. My code is as follows:
|
||
Showing messages 1 through 5 of 5.
-
Connect to MySQL DB
2007-11-04 03:21:29 dashtimothy2000 [Reply | View]
hi good day to you. i got similar problem. Im new to php and i cannot connect to my databse either heres my connection code:
$link = mysql_connect("localhost","my_db","my_passwrd")
or die("Could not connect : " . mysql_error());
Wander if you have got the reply on your prob and if you can help me with ths.
Thank you
Dennis
-
Connect to MySQL DB
2006-05-31 23:12:22 PrabhjotSingh [Reply | View]
HI
I am facing a similar but a litle diffrent problem. My hosting too is at godaddy.com and my sql server is too here but now i want to connect to this mysql from my another web server which is not on godaddy.com. I think its netsol or somewhat. If you get solution for urs could you solve mine pls.
Thanks





mysql_connect($hostname,$username, $password) or die ('Error connecting to mysql');
mysql_select_db($dbname);
it might work. since you were making the mysql cnnection a variable, your database connection couldn't use it. now if you make the mysql connection not a variable then anything in the script can access it.