logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 09-16-2007, 11:19 AM   #1
mhtahir
 
Join Date: Aug 2007
Posts: 10
Default when i use this php, look down error comes

<?
//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
mhtahir is offline   Reply With Quote
Old 09-16-2007, 04:37 PM   #2
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

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?
domedia is offline   Reply With Quote
Old 09-17-2007, 01:43 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

check that your connection details are correct especially username
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 09-17-2007, 05:37 AM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

i would say HOST is incorrect
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com