I'm twisting up variables and knotting up my brain on this one. I've searched and found similar solutions which have helped, but I'm still hitting a brick wall here.
This query is used to feed a page that displays upcoming calendar events, but drops all events greater than 1 week old
$datemin variable defines the minimum date for selected entries
date_start is the field name in MM/DD/YYYY format.
I want the date displayed as "l, F jS, 'y" (Monday, March 8th, 2010) format, and I've got that taken care of properly when it outputs the data.
How do I write the query so that the dates chosen are only those greater than the $datemin variable?
$datemin = mktime(0, 0, 0, date("m"), date("d")-7, date("Y"));
$table_name = 'fog_table';
$currenttime = strtotime(now);
// This is the basic query and works fine,
// but doesn't drop dates over a week old
// $query = "SELECT * FROM $table_name order by date_start ASC";
// This is the query I am trying to fix
$query = "SELECT *,date_format(date_start'%l, %F %jS, %Y')
FROM $table_name
WHERE date_start' < '$datemin'
order by date_start ASC";