PDA

View Full Version : when i use this php, look down error comes


mhtahir
09-16-2007, 12:19 PM
<?
//replace username and password with your mysql name and password
$conn = mysql_connect("mysql","user1","user123");
//select the database
$db = mysql_select_db("tahir");
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
//insert the values
$result= MYSQL_QUERY("INSERT INTO tahir (id, username, password, email)".
"VALUES ('NULL', '$username', '$password', '$email')");

echo "Your name and password have been submitted into our database :)";
?>


Warning: mysql_connect(): Unknown MySQL Server Host 'mysql' (1) in /home/www/hafeeztahir.freehostia.com/make.php on line 11

Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/hafeeztahir.freehostia.com/make.php on line 14

Warning: mysql_select_db(): A link to the server could not be established in /home/www/hafeeztahir.freehostia.com/make.php on line 14

Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/hafeeztahir.freehostia.com/make.php on line 22

Warning: mysql_query(): A link to the server could not be established in /home/www/hafeeztahir.freehostia.com/make.php on line 22
Your name and password have been submitted into our database :)

domedia
09-16-2007, 05:37 PM
Hey mhtahir, I'm not a programmer, but it seems that you're getting told exactly what the error is. What do you think the error message means?

edbr
09-17-2007, 02:43 AM
check that your connection details are correct especially username

davidj
09-17-2007, 06:37 AM
i would say HOST is incorrect