I'm trying to select database entries based on date, and I ran across something that seemed so simple, I had to try it. This is my statement:
$result = mysql_query("SELECT * FROM `outage` WHERE status='Clear' OR status='Cleared' OR status='Resolved' AND date BETWEEN curdate() AND date_sub(curdate(), INTERVAL 1 weeks) ORDER BY id");
Its supposed to specify a date range of today (curdate) and a week ago (the date_sub bit). However, I get an error message when attempting to call mysql_fetch_array with $result as an argument. It says its not a valid resource. I know this is more of a mySQL question than PHP, but you guys never let me down. Thanks in advance!