To give you a little background, this is part of a calendar script that is searching for events in my database to populate the calendar.
Here is the query:
PHP Code:
$e_query = mysql_query( "
SELECT fnID, fnEventCategory, DATE_FORMAT(fdDateTime, '%l:%i') as time, fnHomeTeamID, fnAwayTeamID, fnHomeTeamScore, fnAwayTeamScore
FROM tblGame, tblEvent
WHERE
fnEventID = fnGameID
AND
DATE_FORMAT(fdDateTime, '%Y-%c-%e %H:%i:%s') > STR_TO_DATE($e_query_date, '%Y-%c-%e %H:%i:%s')
AND
DATE_FORMAT(fdDateTime, '%Y-%c-%e %H:%i:%s') < STR_TO_DATE($e_query_uDate, '%Y-%c-%e %H:%i:%s')
" );
fdDateTime is a DATETIME. I realize that using DATE_FORMAT on it might infact alter the format so it is not a DATETIME anymore, but I tried it without the DATE_FORMAT and it was the same error.
$e_query_date is a string that is a value like '2004-1-1 00:00:00'
$e_query_uDate is a string that is a value like '2004-1-1 23:59:59'
Here is the error message: