Im having a issue with comparing dates below is the code. it shows all rows even dates that have passed todays date. The Date field is set as date in sql.
<?php
$con = mysql_connect("localhost","myusername","mypassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mydatabase", $con);
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$result = mysql_query("SELECT * FROM event where 'date' < $today");
while ($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['Id'] . "</td>";
echo "<td>" . $row['Date'] . "</td>";
echo "<td>" . $row['ArtistDate'] . "</td>";
echo "<td>" . $row['Artist'] . "</td>";
echo "<td>" . $row['ImagePath'] . "</td>";
echo "<td>" . $row['ImgLink'] . "</td>";
echo "<td>" . $row['IncFile'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>