I have a php script that looks like this (shortened/edited for clarity of course):
$result = mysqli_query($link, 'SELECT date FROM table');
while ($row = mysqli_fetch_assoc($result)) {
if ($row["date"] < time())
{
do some stuff
}
else
do something else
The date is stored in a DATE field in MySQL. I have no interest in storing time and only the date is stored in that field in XXXX-XX-XX format.
How can I check if the retrieved date is today or earlier? By using time() there, which was the last thing I ended up trying, my script is acting as if all retrieved dates are today or earlier, even when they are not.
Thank you for any help with this.