Follow us on Twitter!
Your life is ending one minute at a time. If you were to die tomorrow, what would you do today?
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 23
Guests Online: 20
Members Online: 3

Registered Members: 82886
Newest Member: The Slummy
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

PHP Update HELP!!!!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-07-07 23:38
I am trying to update a MySQL database and add a number to an variable that already has an int stored in to for example i ahve 10 and i want to add 10 so it will make 20 when i UPDATE points SET points += 10 FROM users WHERE user_name= $_SESSION['user_name'] it will not update my SQL i was wondering what i was doing wrong.

Also i need some help with then printing off that session variable when i change the number to anything but 0 it does not show the number i use echo $_SESSION['points'];

Please i really would like some help with this

*** also if your intrested in helping develop my webpage let me know
http://blackmind.. . .munity.org




Edited by on 17-07-07 23:48
Author

RE: PHP Update HELP!!!!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 18-07-07 01:40
i dont think sql supports the += operator so just use


$current_points = mysql_result(mysql_query("SELECT points FROM users WHERE user_name = '" . mysql_real_escape_string($_SESSION["user_name"]) . "'"Wink, 0);
$points = $current_points + 10;
$update = mysql_query("UPDATE users SET points = $points WHERE user_name = '" . mysql_real_escape_string($_SESSION["user_name"]) . "'"Wink;


as to your other problem, I'd have to see more of your code.