shchb Posted March 15, 2008 Share Posted March 15, 2008 A beginner question about MySQL, hope someone can help me. I want to increase some of the value of a column in a table, for example, in table_item, I want to increase all item_price which are less than 5 by 10 what should be the SQL for this? Thanks!! MySQL version: 4.1.22 Link to comment https://forums.phpfreaks.com/topic/96284-how-to-modify-the-value-of-a-column/ Share on other sites More sharing options...
paul2463 Posted March 15, 2008 Share Posted March 15, 2008 <?php $query = "UPDATE table_item SET item_price = item_price + 10 WHERE item_price < 5 "; mysql_query($query) or die ("Error in query" . mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/96284-how-to-modify-the-value-of-a-column/#findComment-492914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.