Dobakat Posted August 1, 2006 Share Posted August 1, 2006 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 More sharing options...
AndyB Posted August 1, 2006 Share Posted August 1, 2006 ORDER is a reserved word - http://htmlite.com/mysql002a.phpYou 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 More sharing options...
Dobakat Posted August 1, 2006 Author Share Posted August 1, 2006 silly mistakes.. thanks.. Link to comment Share on other sites More sharing options...
Recommended Posts