Help with php/MySQL query [solved]
Posted: Tue Sep 18, 2007 9:32 am
Hello,
I'm trying to pull records from a MySQL database using a sql query - to pull records where the "exp_date" field is greater than or equal to today. How do I do this?
Here is my query:
... but this is obviously not working because I don't know how to add today's date/time dynamically to the query.
Any help would be great!
[/quote]
I'm trying to pull records from a MySQL database using a sql query - to pull records where the "exp_date" field is greater than or equal to today. How do I do this?
Here is my query:
Code: Select all
$query = "SELECT v_title,link_id,v_descr,hw_added,hw_region_id,approved,user_approved,exp_date FROM ec3_ad WHERE hw_feat=1 AND approved=1 AND user_approved=1 AND hw_region_id=103 AND exp_date>=strftime('%d %b %Y %H:%M:%S') ORDER BY hw_added DESC LIMIT 20";Any help would be great!
[/quote]