I want to create a graph of items on a certain day using data from a MySQL database. I have the query
SELECT * FROM activities
WHERE timestamp BETWEEN UNIX_TIMESTAMP() - 24 * 3600 * 7
AND UNIX_TIMESTAMP() - 24 * 3600 * 6
to select items from x days ago (where the 7 and 6 can vary in order to select the day), but it’s returning an empty set in my database for some reason.
Try below:
Replace
start_datewith yourstartdateandx with interval