Jump to content

PHP - SQL User Points System Help!!!!!!!!!~~~!!!~~!!!


robbins

Recommended Posts

How can I make a php script that uses a mysql database... and when the user adds "points" to a specific section (eg: strength), then it subtracts from they're alotted "total" points and adds the points to the strength section. 

 

Like so if i were a member, i had 10 total points, and i could add like 3 to strength and 2 to defense then it would take 5 from my total points, and add 3 to strth and 2 to dfnce...

 

Please let me know how to do this??  multiple querys?

Link to comment
https://forums.phpfreaks.com/topic/40964-php-sql-user-points-system-help~~~~~/
Share on other sites

just a few queries to handle it.

 

Query 1: Update the table to display the new strength they desire

 

Query 2: Select the total points/points left and the number of points they applied to strength, and put those in variables.

 

Do some math here to subtract the applied points from the total and apply that number to a variable.

 

Query 3:  Update the table, changing to total points to the new number stored in your math variable!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.