Basically I have a website where user vote on projects posted by users or “Support” everytime a user clicks the support button, it goes into a table and stores 3 things, a normal auto increment identifier, the user_id that ‘supported’ it and the project id they supported. Now everyday we want to display ‘Top projects’ on the homepage. This will my guess be done with a php script and a cron job. I can’t really think of how to query the database properly to determine X amount of top projects. (Most likely 5 or 10) Iv’e thought about this for a while, but I can’t think of an answer. Any ideas/answers help alot! Thanks.
Share
Well, your going to have to add a time stamp of one sort or another to that database. So you can query by the day from midnight to 11:59p. I’d say
datetimeformat ie:YYYY-MM-DD HH:MM:SS(its in 24 hour format)From that if handled correctly you could do something like