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 https://forums.phpfreaks.com/topic/16161-dont-see-whats-wrong-with-php-mysql-query-here/ 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 https://forums.phpfreaks.com/topic/16161-dont-see-whats-wrong-with-php-mysql-query-here/#findComment-66792 Share on other sites More sharing options...
Dobakat Posted August 1, 2006 Author Share Posted August 1, 2006 silly mistakes.. thanks.. Link to comment https://forums.phpfreaks.com/topic/16161-dont-see-whats-wrong-with-php-mysql-query-here/#findComment-66794 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.