dflow Posted December 14, 2008 Share Posted December 14, 2008 ok this should be simple but i messed it up: SELECT LangHEB FROM contact_form_BACKUP UPDATE contact_form_BACKUP SET Lang='1' WHERE ProductID BETWEEN '100' AND '120' this is what logically i want to do what am i doing wrong? Link to comment https://forums.phpfreaks.com/topic/136948-update-a-column-between-a-range/ Share on other sites More sharing options...
T Horton Posted December 14, 2008 Share Posted December 14, 2008 Hi Not sure why you are putting the "SELECT" statement at the beginning, but in order to update any records where the product ID is between 100 and 120, you would need to use the following SQL: <?php $sql = mysql_query("UPDATE contact_form_BACKUP SET Lang='1' WHERE ProductID BETWEEN '100' AND '120'"); ?> Hope this helps. Tom Link to comment https://forums.phpfreaks.com/topic/136948-update-a-column-between-a-range/#findComment-715251 Share on other sites More sharing options...
dflow Posted December 15, 2008 Author Share Posted December 15, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/136948-update-a-column-between-a-range/#findComment-715720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.