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."'"); Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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."'"); Quote Link to comment Share on other sites More sharing options...
gple Posted January 23, 2008 Author Share Posted January 23, 2008 that works. thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.