Posted by Alan Robertson on 10/01/99 11:30
Apologies for asking such a stupid question, but I've just spent the last
four hours trying to solve it myself and failed!
I'm a complert enovice at this php/mysql thing so I'll just get straight
into it.
I have create mysql db that has a field 'start_date' in the datetime format.
I also have a string in PHP formated as $expiry = date("Y-m-d H:i:s").
All I want is a select query that will return the rows of data where the
'start_date' field is less than the $expiry variable.
But I am having no luck what so ever.
$query = "SELECT * FROM `tbl_markets` WHERE 'start_date' < '$expiry'";
Not exactly rocket science - but I'm pulling my hair out here.
can anyone think what i need to do. I've tried using DateFormat on the
'start_date' incase it gets converted into a string from mysql, but that
didn't make any difference either.
Regards
Alan
[Back to original message]
|