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..
Link to comment
Share on other sites

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`
Link to comment
Share on other sites

Guest
This topic is now 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.