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. 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. 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. Link to comment https://forums.phpfreaks.com/topic/210684-mysql-syntax-error/#findComment-1099064 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.