MyBB Community Forums

Full Version: PHP Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to display only queries from this week, but it doesn't seem to work.
Here's what I have:
$data = mysql_query("SELECT * FROM list ORDER BY `rating` DESC LIMIT 0,9") or die(mysql_error());
(I already took out all the things I added).
I have a date column already, so it should be relatively simple.
Thanks!
Your query should be more like :

$thisweek = time() - (7 * 24 * 60 * 60);
$data = mysql_query("SELECT * FROM list WHERE date > $thisweek ORDER BY `rating` DESC LIMIT 0,9")
 or die(mysql_error());
Wink