php - Daily/Weekly/Monthly Highscores -
I have an online highscoak made of php + mysql, but it currently shows all time highscore, I Daily / Weekly Want to add / that month and I was wondering what would be the best way?
My current idea is to add 3 new tables and then there is data inserted in each of them, and then having a cron should run at the appropriate time to delete the data from each table.
Is there a better way I can do?
There is one more thing, I want to keep it so that the page is Highscore .php? T = all t = daily, etc.
Thanks
Use a table and mark the date of the highest score Add column. After that there are three separate questions for each time, eg.
Highscore where SELECT ... from Date & gt; "05-12-2011"; If you want to keep a normal version without a definite date, then use one of these:
where highcorse from SELECT ... Date & Gt; = Curdate () - INTERVAL DAYOFWEEK (curdate ()) + 6 DAY;
Comments
Post a Comment