Error with query[TOPIC SOLVED]
Posted: Mon Aug 27, 2007 5:28 pm
Im getting this error:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #5' at line 1 with query Resource id #5
But no idea what its trying to explain to me to fix... its the same query as used in the "elseif" part of my if statement which works 100% yet the exact same when copy n pasted doesnt lol!
How ever i have a second query in this "if" region which i guess could be it... can any one tell me what i have done wrong? Heres the 2 only possible queries that it could be:
OR
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #5' at line 1 with query Resource id #5
But no idea what its trying to explain to me to fix... its the same query as used in the "elseif" part of my if statement which works 100% yet the exact same when copy n pasted doesnt lol!
How ever i have a second query in this "if" region which i guess could be it... can any one tell me what i have done wrong? Heres the 2 only possible queries that it could be:
Code: Select all
$CheckUserID = mysql_query("SELECT * FROM userregistrationWHERE UserID='$UserID'"); $GetUserID = mysql_query($CheckUserID) or die("Error: ". mysql_error(). " with query ". $CheckUserID); If (!($row = mysql_fetch_assoc($CheckUserID))) { die('This Username does not exist!'); }
OR
Code: Select all
$secondquery = "INSERT INTO `messages` (Reciever, Sender, Senttime, MessageText, Subject) Values ('$UserID', '$Sender', '$Date', '$MessageText', '$Subject')"; mysql_query($secondquery) or die(mysql_error(). " with query ". $secondquery); // get useful error message