acidglitter Posted August 8, 2007 Share Posted August 8, 2007 mysql_query("UPDATE table SET field='$value' WHERE class='2'"); How can I make that update every row where the class is 2 or greater? Quote Link to comment https://forums.phpfreaks.com/topic/63832-solved-simple-mysql-query-help/ Share on other sites More sharing options...
teng84 Posted August 8, 2007 Share Posted August 8, 2007 WHERE class >= 2 is that????????????? Quote Link to comment https://forums.phpfreaks.com/topic/63832-solved-simple-mysql-query-help/#findComment-318141 Share on other sites More sharing options...
acidglitter Posted August 8, 2007 Author Share Posted August 8, 2007 no that didn't work I tried WHERE class='>=2' and WHERE class=>=2 Quote Link to comment https://forums.phpfreaks.com/topic/63832-solved-simple-mysql-query-help/#findComment-318156 Share on other sites More sharing options...
aim25 Posted August 8, 2007 Share Posted August 8, 2007 its >= not => Quote Link to comment https://forums.phpfreaks.com/topic/63832-solved-simple-mysql-query-help/#findComment-318167 Share on other sites More sharing options...
acidglitter Posted August 8, 2007 Author Share Posted August 8, 2007 It has a limit, so I found another way that works mysql_query("UPDATE table SET field='$value' WHERE (class='2' OR class='3' OR class='4')"); Quote Link to comment https://forums.phpfreaks.com/topic/63832-solved-simple-mysql-query-help/#findComment-318171 Share on other sites More sharing options...
teng84 Posted August 8, 2007 Share Posted August 8, 2007 better doing this with the between clause b where class betwen 2 and 4 something like that Quote Link to comment https://forums.phpfreaks.com/topic/63832-solved-simple-mysql-query-help/#findComment-318173 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.