Jump to content

Don't see whats wrong with PHP + MySql Query here..


Dobakat

Recommended Posts

I run this code..[code]mysql_query("UPDATE bf SET price='$price'  WHERE location='$fetch->location' &&owner='$username' && name='$store2'");[/code]
and it runs perfectly.. then i copy paste it, change price to order.. it doesn't work..
[code]mysql_query("UPDATE bf SET order='$order' WHERE Name='$store2' && owner='$username' && location='$fetch->location'")
[/code]
The mysql table is set the same,and the $order does work.. if i put 10, then echo $order; it works perfectly..
ORDER is a reserved word - http://htmlite.com/mysql002a.php

You can't name a table column with a reserved word.  The best solution is to change order to x_order or some non-reserved word.  You can also (sloppy solution) wrap reserved words with backticks ... `order`

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.