Jump to content


Photo

adding to a number


  • Please log in to reply
2 replies to this topic

#1 hogwan.com

hogwan.com
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationSouth Korea

Posted 08 April 2003 - 02:50 PM

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?
Regards; [br]S. Taylor [br]Korea [br]************* [br]No sig... [br]forgot how to write....

#2 DocSeuss

DocSeuss
  • Members
  • PipPipPip
  • Advanced Member
  • 73 posts
  • LocationTexas, USA

Posted 08 April 2003 - 03:13 PM

$query = \"UPDATE stats SET points = points + 150 WHERE id = \'$user\' \";

http://www.mysql.com.../en/UPDATE.html
"Unlimited budget? Great, for $5,000,0000 we will run your ad banner for one year"  ----Rasmus Lerdorf

#3 hogwan.com

hogwan.com
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationSouth Korea

Posted 08 April 2003 - 03:25 PM

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.
8)

Just so you know I have been playing with that for 3 days.....

Thanks again.
Regards; [br]S. Taylor [br]Korea [br]************* [br]No sig... [br]forgot how to write....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users