SQL Query with Date Function
Posted: Mon Jun 28, 2010 10:49 am
I am trying to select records out of my database using a SQL statement where a date field is one day greater than today
Would this be the correct syntax using the TODAY function and INTERVAL
I'm getting an error trying to fetch these records.
$query = mysql_query("SELECT * FROM courses where course_stat = 'A' and course_stdate = TODAY() + INTERVAL 1");
while ($row = mysql_fetch_array($query)) - get error "supplied argument not valid"
course_stdate is defined as a date type in my database with format yyyy-mm-dd
Would this be the correct syntax using the TODAY function and INTERVAL
I'm getting an error trying to fetch these records.
$query = mysql_query("SELECT * FROM courses where course_stat = 'A' and course_stdate = TODAY() + INTERVAL 1");
while ($row = mysql_fetch_array($query)) - get error "supplied argument not valid"
course_stdate is defined as a date type in my database with format yyyy-mm-dd