I am trying to query my database for information that was entered along with the CURDATE() attribute, today, this week, this month.
SHould the above code be giving me all results for the last week? When i run it it returns 0 results.
However, when i run this:
It gives me anything that was added today.
ANy help is appreciated.
Code:
if($type == "bestweek"){
$sql = "SELECT id, entrytext, positive, negative, verified, date, realtime FROM hmr WHERE verified > 2 AND DATE(realtime) = CURDATE()-7 ORDER BY positive DESC LIMIT $start, $limit";
$result = mysql_query($sql);
}
SHould the above code be giving me all results for the last week? When i run it it returns 0 results.
However, when i run this:
Code:
if($type == "besttoday"){
$sql = "SELECT id, entrytext, positive, negative, verified, date, realtime FROM hmr WHERE verified > 2 AND DATE(realtime) = CURDATE() ORDER BY positive DESC LIMIT $start, $limit"; $result = mysql_query($sql);
}
ANy help is appreciated.