Hi all,
I'm really struggling with this and so far haven't been able to find a solution on the Internet. I have a MySQL table called Journey which has a Date field. The dates are stored in the format YYYY-MM-DD. I'm trying to construct a query where I can get all JourneyIDs matching a specific date so what I do first is to create a date object in PHP:
$searchDate = mktime(0,0,0,4,18,2011);
I then create the query converting the date object to the same format as stored in the database:
$query="SELECT JourneyID FROM Journey WHERE 'Date' = " . date("Y-m-d", $searchDate);
if ($records=@mysql_query($query)) { ...
This never returns anything, even though with some dates I patch into it, I know there are multiple records.
Please help me, what am I doing wrong?
Thanks a lot.