When trying to use MySQL's DATE_SUB function, I receive a 'unexpected token' error when it encounters the INTERVAL parameter.
$trendsRow = Metars::find(array(
"conditions" => "station_id = ?1 AND loaded BETWEEN DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 DAY) AND UTC_TIMESTAMP()",
"bind" => array(1 => $this->stationID),
"order" => "loaded DESC",
));
Syntax error, unexpected token INTEGER(1), near to ' DAY) AND UTC_TIMESTAMP() ORDER BY loaded DESC', when parsing: SELECT [Metars].* FROM [Metars] WHERE station_id = ?1 AND loaded BETWEEN DATE_SUB(UTC_TIMESTAMP(),INTERVAL 1 DAY) AND UTC_TIMESTAMP() ORDER BY loaded DESC (154)