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? 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????????????? 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 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 => 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')"); 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 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
Archived
This topic is now archived and is closed to further replies.