php - How to handle game scores of last week in MySQL Table -


i have game_scores table in mysql db having simple columns this

userid totalscore 

the table storing total score done user. need alter above table or create new 1 can handle lastweek , thisweek , totalscore aswell.so may need change above table below

userid totalscore thisweekscore lastweekscore 

i know best , efficient way handle this.

please let me know guys new mysql.

thanks.

i create 2 tables:

userid 

and

scores 

where scores table has score, date, , user_id field.

i thisweekscore using

select * userid join scores on userid.id = scores.user_id scores.date >= curdate() - interval dayofweek(curdate())+6 day , scores.date < curdate() 

and lastweekscore using similar technique.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -