newprogram Posted April 20, 2010 Share Posted April 20, 2010 I want to be able to update let say anyone with the userid in the rang of 300 to 500 change thier column's which has the name "staic" from "paid" to "not paid". Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/ Share on other sites More sharing options...
F1Fan Posted April 20, 2010 Share Posted April 20, 2010 UPDATE table SET staic = 'not paid' WHERE userid BETWEEN 300 AND 500 Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/#findComment-1045460 Share on other sites More sharing options...
newprogram Posted April 20, 2010 Author Share Posted April 20, 2010 thank you !! UPDATE table SET staic = 'not paid' WHERE userid BETWEEN 300 AND 500 Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/#findComment-1045461 Share on other sites More sharing options...
newprogram Posted April 21, 2010 Author Share Posted April 21, 2010 can you please help with one more thing , wont to add a check to only change the ones with "static =Â USA2" I tried this and it not working. UPDATE table SET static = USA1 WHERE static =Â USA2 AND id BETWEEN 300 AND 500 Â thank you !! Â Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/#findComment-1045529 Share on other sites More sharing options...
F1Fan Posted April 21, 2010 Share Posted April 21, 2010 Strings must have single quotes around them. UPDATE table SET static = 'USA1' WHERE static = 'USA2' AND id BETWEEN 300 AND 500 Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/#findComment-1045531 Share on other sites More sharing options...
newprogram Posted April 21, 2010 Author Share Posted April 21, 2010 I getting this = 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 ''USA2' AND id BETWEEN 300 AND 500' at line 1 Strings must have single quotes around them. UPDATE table SET static = 'USA1' WHERE static = 'USA2' AND id BETWEEN 300 AND 500 Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/#findComment-1045536 Share on other sites More sharing options...
newprogram Posted April 21, 2010 Author Share Posted April 21, 2010 my bad i got it forgot a "=" thank you work great I getting this = 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 ''USA2' AND id BETWEEN 300 AND 500' at line 1 Strings must have single quotes around them. UPDATE table SET static = 'USA1' WHERE static = 'USA2' AND id BETWEEN 300 AND 500 Quote Link to comment https://forums.phpfreaks.com/topic/199188-how-would-i-update-multiple-rows-in-mysql/#findComment-1045540 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.