Stooney Posted December 8, 2007 Share Posted December 8, 2007 having some probs, just checking my syntax: (mysql 5) $query=("UPDATE `stauctioneer_tableitems` SET `itemnum`='1' WHERE `table` = '11' AND `slot`='1'"); Link to comment https://forums.phpfreaks.com/topic/80751-mysql-update-query/ Share on other sites More sharing options...
BenInBlack Posted December 8, 2007 Share Posted December 8, 2007 why are you quoting what appears to be integer columns ='1' = '11' "UPDATE stauctioneer_tableitems SET itemnum = 1 WHERE table = 11 AND slot=1" Link to comment https://forums.phpfreaks.com/topic/80751-mysql-update-query/#findComment-409602 Share on other sites More sharing options...
Stooney Posted December 8, 2007 Author Share Posted December 8, 2007 well those are generally variables, that line was the result of my printing the query. so pre-print: $update="UPDATE `stauctioneer_tableitems` SET `itemnum`='$slot[$k]' WHERE `table` = '$tableid' AND `slot`='$k'"; Link to comment https://forums.phpfreaks.com/topic/80751-mysql-update-query/#findComment-409603 Share on other sites More sharing options...
noidtluom Posted December 8, 2007 Share Posted December 8, 2007 well those are generally variables, that line was the result of my printing the query. so pre-print: $update="UPDATE `stauctioneer_tableitems` SET `itemnum`='$slot[$k]' WHERE `table` = '$tableid' AND `slot`='$k'"; Remove the single quotes around the variables. Link to comment https://forums.phpfreaks.com/topic/80751-mysql-update-query/#findComment-409609 Share on other sites More sharing options...
revraz Posted December 8, 2007 Share Posted December 8, 2007 Syntax looks right, what error do you get? If its just not updating, make sure you are in fact sending the right type of data for that column. If they are all set to Integer, make sure your variables are not Strings. Put a error check after the query to see if you have a error in your statement. Link to comment https://forums.phpfreaks.com/topic/80751-mysql-update-query/#findComment-409716 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.