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 Quote Link to comment 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()); ?> Quote Link to comment 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.