Saberman Posted August 10, 2009 Posted August 10, 2009 can anyone help me here plaease i am making a modification for travel for my game and also i made it so you will need a laptop to mail someone but i get this error when i select the inventry item QUERY 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 '' at line 1 Query was SELECT inv_itemid FROM inventory where inv_itemid=27 AND inv_userid= $hdd=$db->query("SELECT inv_itemid FROM inventory where inv_itemid=27 AND inv_userid=$userid"); $jkk=$db->fetch_row($hdd); Quote
POG1 Posted August 11, 2009 Posted August 11, 2009 Re: mail error Try the query in phpMyadmin and see if it works, if it does then its the php code. You could also try doing it differently; $result = $db->query("SELECT COUNT(inv_itemid) AS gotItem FROM inventory WHERE inv_itemid = 27 AND inv_userid = ".$userid." LIMIT 1;"); $itemCheck = $db->fetch_row($result); if($itemCheck['gotItem']) { echo 'yes!'; } else { echo 'no'; } *I have not tested this Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.