Records from $mysql_table:
id | animal | my_timeStamp
1 | deer | 2017-10-03 11:12:28
2 | dog | 2017-10-08 12:19:08
3 | bird | 2017-10-11 10:32:56
4 | fish | 2017-10-15 11:07:34
$result = mysqli_fetch_assoc(mysqli_query($conn, "select * from mysql_table"));
I want to display animals from LESS than 2 days ago, but the following does not work because "curdate()" is a mySQL and not a PHP function:
if($result['my_timeStamp'] > curdate() -2) { //do something }
What can I change in that line of code to make it work?
(Note: for "learning purposes" I don't want to change my mySQL 'select' statement -- I just want to learn what to do on the PHP "result" side of things 🙂