CMC Posted November 22, 2008 Share Posted November 22, 2008 Hi, Is there a built-in function to add 1 to a row without having to query the db, return a value, add 1 to it, and update the row? I've been looking all over but I haven't been able to efficiently phrase my question so I get optimal results on a search engine :/ Thanks for any input Quote Link to comment https://forums.phpfreaks.com/topic/133743-solved-1-to-a-row/ Share on other sites More sharing options...
xtopolis Posted November 22, 2008 Share Posted November 22, 2008 All of them? UPDATE yourTable SET col= col + 1; One of them? UPDATE yourTable SET col= col + 1 WHERE idCol = 3; Lots? UPDATE yourTable SET col= col + 1 WHERE idCol IN('3','4','5'); Quote Link to comment https://forums.phpfreaks.com/topic/133743-solved-1-to-a-row/#findComment-696006 Share on other sites More sharing options...
CMC Posted November 22, 2008 Author Share Posted November 22, 2008 Ah thanks, I was just actually thinking of trying exactly that Quote Link to comment https://forums.phpfreaks.com/topic/133743-solved-1-to-a-row/#findComment-696007 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.