Using MySQL and PHP, I have a simple ranking table with 2 columns user
and score
.
Once a week, I re-run the ranking script and it computes scores for each user.
- many users have new scores
- some do not
- some times there are new users to add to the table
What's the best way to approach this with MySQL? Does update
work if I need to add new rows? Would insert
override existing rows such that I could just insert the entire table again? Would it be best to just drop the table and re-write it from scratch?
**Sample Data**
User01 2500
User02 3000
User03 100
**New Data to be Added**
User01 2700
User02 4000
User04 1000 // new account
Except with thousands of users...