How to make an addition to a MySQL column?
I want to make a "like" sort of button. It should basically +1 a value on the database called 开发者_如何学GoLikes. I can simply retrieve the value, do the addition and insert it again but I'm wondering if there is an easier way. Thanks
UPDATE Likes SET likeCount = likeCount + 1 WHERE likeID = ?
If you need to keep track of a value, then it is necessary that you store it. In the alternative, you might want to consider using a normal text file if you don't already have a database running. Hope it helps.
精彩评论