$sinceDate = date('m-d-Y'); $query="SELECT * FROM `pollinfo` WHERE pollClientID=2 and isLive=1 and DATE_FORMAT(startDate,'%m-%d-%Y')<=$sinceDate ORDER BY startDate DESC";
Can anybody tell me if this is in correct form?
Thanks!
you don't need the PHP variable:
SELECT * FROM pollinfo WHERE pollClientID = 2 and isLive = 1 and startDate <= CURDATE ORDER BY startDate DESC