Right now I have the following query:
$sth = $dbh->prepare('SELECT * from training ORDER BY startDate ASC LIMIT 4');
Then, I process it further like this:
if($row['endDate'] > $today && $row['status'] != '2')
How can I combine the if
statement into the db query? I'm not sure how to check the endDate
and compare it to today's date in the query.