drseuss Posted August 14, 2010 Share Posted August 14, 2010 I've been trying to figure this error out for a while now. $sql = "select * inventory where pid=".$settings['user']['stats']['id']." AND id=".$itemId; $result = $db->db_query($sql); $item = $db->db_fetch_array($result); I use have been doing all of my queries like this. But now I get an error like this. 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 'inventory where pid=1 AND id=1' at line 1 Please help me figure it out. Quote Link to comment https://forums.phpfreaks.com/topic/210684-mysql-syntax-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 14, 2010 Share Posted August 14, 2010 You are missing the FROM keyword. Quote Link to comment https://forums.phpfreaks.com/topic/210684-mysql-syntax-error/#findComment-1099063 Share on other sites More sharing options...
drseuss Posted August 14, 2010 Author Share Posted August 14, 2010 Yup... Looks like I do need to go to bed... Thanks a lot. Quote Link to comment https://forums.phpfreaks.com/topic/210684-mysql-syntax-error/#findComment-1099064 Share on other sites More sharing options...
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.