I am trying to compare a date in a mysql database with the current date. If the date has been passed, then the program does something.
My program runs successfully, but I'm pretty sure that there's a more elegant solution out there. I think mine is quite possibly the most brute force solution out there 🙂
$query = "SELECT title, titleurl, organizer, organizerurl, DATE_FORMAT(start, '%b %D, %Y'), DATE_FORMAT(end, '%b %D, %Y'), place, DATE_FORMAT(paperdeadline, '%b %D, %Y'), month(paperdeadline), dayofmonth(paperdeadline), year(paperdeadline) FROM conferences ORDER BY start";
$result = mysql_query($query, $db) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
// I've erased the part where I assign variables to irrelevant table variables
$now = getdate();
if ($now['year']>$deadliney || ($now['year']==$deadliney && $now['mon']>$deadlinem) || ($now['year']==$deadliney && $now['mon'] == $deadlinem && $now['mday']>$deadlined))
$paperdeadline="<font color=\"#FF0000\">$paperdeadline (Deadline Passed)</font>";
}