Where is the problem?
You dynamic PHP page displays the database content.
When the user submits new stats, store it to the database first place in your script. Then load the data from the database and display the current database content - including the newly submitted data - in the same script.
smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
Depends on the stats you need. MySQL can produce basic stats by combining values in certain ways, but complicated stats may be better left to php. Your DB should just store values - try to avoid storing intermediate calculated values. 'Stats' then are calculated on the fly (via query and/or subsequent php functions).
If you need to display updated stats after data input without reloading the page, have a look at Ajax.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Does user login? If yes then when user logs in query his current stats into session. Then when he adds then by clicking a form submit, just take submitted value, add to session value and update database!
evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
UPDATE table1 SET at_bats = at_bats + $newamount WHERE user_id = $id
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
One assignment for each field:
UPDATE table1 SET at_bats = at_bats + $at_bats, hits = hits + $hits WHERE user_id = $id;
smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080