Jump to content
MakeWebGames

Recommended Posts

Posted

Hello again, here's my problem with addtoshop.php mccodes2.

Most of the time when i try to add the same item twice for the same price i get this error:

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 'where id=159' at line 1
Query was update usershopitems set quantity=quantity+ where id=159

 

Changing the prices eliminates the problem.

thanks!

Posted

Re: addtoshop error, please help.

anything i should change here?

$db->query("INSERT INTO usershopitems VALUES ('','{$us['id']}','{$r['inv_itemid']}','{$_GET['price']}','$quantity')");

}

else

{

$theitem=mysql_fetch_array($checkforitem);

$db->query("update usershopitems set quantity=quantity+{$_GET['quantity']} where id={$theitem['id']}");

}

Posted

Re: addtoshop error, please help.

try changing:

$db->query("update usershopitems set quantity=quantity+{$_GET['quantity']} where id={$theitem['id']}");

to

$qty = abs(intval($_REQUEST['quantity']));

$db->query("update usershopitems set quantity=quantity+{$qty} where id={$theitem['id']}");

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...