Jump to content
MakeWebGames

Recommended Posts

Posted

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);

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...