My mySQL table has a column date_added which uses type TIMESTAMP. In the table, the timestamps looks like this 2017-06-17 20:08:58 when I use a visual editor.
In my PHP, I'm trying to only get the rows that have a date_added since one week ago. So, I'm doing something like this:
$weekago = strtotime("-1 week");
$sql = "SELECT * from myTable where date_added >= $weekago";
$weekago returns an epoch time like: 1498748730
If I do a straight mySQL query like this:
select * from myTable where date_added > 1498748730
In either case, I just get all rows returned (and yes, some of the rows have a date_added from more than one week ago).
Is the issue that the timestamp formats aren't matching?