hogwan.com Posted April 8, 2003 Share Posted April 8, 2003 Hello; I want to a number to a members points in my database. So I have this : //add 150 points $query = \"UPDATE stats SET points = \'150\' WHERE id = \'$user\' \"; mysql_query($query, $mysql_access); } else { // false, not working properly } However, I want to ADD points rather than replace the existing points completely. Is there a way to add on points? ...well I am sure there is but my study book (broke down and bought one) doesn\'t show how to attack that problem. Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/323-adding-to-a-number/ Share on other sites More sharing options...
DocSeuss Posted April 8, 2003 Share Posted April 8, 2003 $query = \"UPDATE stats SET points = points + 150 WHERE id = \'$user\' \"; http://www.mysql.com/doc/en/UPDATE.html Quote Link to comment https://forums.phpfreaks.com/topic/323-adding-to-a-number/#findComment-1044 Share on other sites More sharing options...
hogwan.com Posted April 8, 2003 Author Share Posted April 8, 2003 Thanks Doc... Yeah it worked as I am sure you knew...I don\'t feel too much like a shmuck for asking a question with such an easy fix... This board is magic! I enter a question and *poof* there\'s the answer. Just so you know I have been playing with that for 3 days..... Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/323-adding-to-a-number/#findComment-1045 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.