mades - 5:51 pm on Feb 20, 2013 (gmt 0)
I've done the same thing before (not with godaddy though - and it was our teacher at the time who helped us). Anyhow, I do not understand how this code is wrong.
//Connection settings for MySQL
$db_name = 'dbname';
$host = 'localhost'; //IP or localhost
$db_user = 'dbname';
$db_password = 'mypassword';
$connection = mysql_connect($host,$db_user,$db_password);
Also, for the localhost, I tried 127.0.0.1 but to no avail.
Unless I am completely wrong, shouldn't THIS work? On godaddy, it says that the name and the user is the same (they grouped them as one, I dunno why).
After typing in the url and pressing enter, it gives me THIS error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/21/10535121/html/connection.php on line 11
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/content/21/10535121/html/connection.php on line 12