gple Posted January 23, 2008 Share Posted January 23, 2008 $id and $order both output what I passed them. why doesnt the update work? $id=$_POST['id'.$i]; $order=$_POST['order'.$i]; mysql_query("UPDATE type_size set order='".$order."' where id='".$id."'"); Link to comment https://forums.phpfreaks.com/topic/87324-whats-wrong-with-this-code/ Share on other sites More sharing options...
teng84 Posted January 23, 2008 Share Posted January 23, 2008 put sql error reporting to know your error mysql_query("UPDATE type_size set order='".$order."' where id='".$id."'") or die (mysql_error()); try and tell us what happen Link to comment https://forums.phpfreaks.com/topic/87324-whats-wrong-with-this-code/#findComment-446630 Share on other sites More sharing options...
gple Posted January 23, 2008 Author Share Posted January 23, 2008 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 'order='9' where id='45'' at line 1 Link to comment https://forums.phpfreaks.com/topic/87324-whats-wrong-with-this-code/#findComment-446631 Share on other sites More sharing options...
sasa Posted January 23, 2008 Share Posted January 23, 2008 order is reserved Word try mysql_query("UPDATE type_size set `order`='".$order."' where id='".$id."'"); Link to comment https://forums.phpfreaks.com/topic/87324-whats-wrong-with-this-code/#findComment-446634 Share on other sites More sharing options...
gple Posted January 23, 2008 Author Share Posted January 23, 2008 that works. thanks Link to comment https://forums.phpfreaks.com/topic/87324-whats-wrong-with-this-code/#findComment-446636 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.