Jump to content

MySQL Syntax Error


drseuss

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.