I have several activities in my database, but I would like to hide the ones from the past, so I modified my MySQL request:
$sql = "SELECT * FROM tblAgenda WHERE date <= CURDATE() order by date ASC";
But it doesn’t do a thing except giving errors. What’s wrong?
It seems like you’re not getting any results, so that is throwing errors. You always need to check for results before looping, you cannot just assume that every query will return something.
Also, if you want things from the present/future, your comparison operand is backward:
Putting it together: