lilman Posted November 19, 2006 Share Posted November 19, 2006 Here is my code:[code]$insert = "INSERT INTO hotornot (username,path,gender,score,num_of_votes,sum_of_score) VALUES ('$username','$path','$gender','0','0','0')";Line # 78: $result = mysql_query($insert) or die("Error ". mysql_error. " with query ". $insert);[/code]Error:[quote]Notice: Use of undefined constant mysql_error - assumed 'mysql_error' in /home2/usname/public_html/site/hotornot/insert.php on line 78Error mysql_error with query INSERT INTO hotornot (username,path,gender,score,num_of_votes,sum_of_score) VALUES ('lilman','lilman.jpg','Male','0','0','0')[/quote]I don't see anything wrong with what I got. The SQL Insert command seems fine, the variables all have values, I don't get... what is it that I am missing? Link to comment https://forums.phpfreaks.com/topic/27806-insert-error/ Share on other sites More sharing options...
fert Posted November 19, 2006 Share Posted November 19, 2006 it's mysql_errror() not mysql_error Link to comment https://forums.phpfreaks.com/topic/27806-insert-error/#findComment-127219 Share on other sites More sharing options...
glenelkins Posted November 19, 2006 Share Posted November 19, 2006 Hiyou have set mysql_error here as a constant, mysql_error is a function returning a human readable error so should read as follows:[code]$result = mysql_query($insert) or die("Error " . mysql_error() . " with query " . $insert);[/code] Link to comment https://forums.phpfreaks.com/topic/27806-insert-error/#findComment-127221 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.