I have a table in which I store the data I get using PHP from the API, the table looks like this:
| ID | count | timestamp |
|---|---|---|
| 6285 | 123 | 21.11 18:54 |
| 6284 | 122 | 21.11 18:53 |
| 6283 | 121 | 21.11 18:52 |
| 6282 | 120 | 21.11 18:51 |
What I want to achieve is something like: In the last 24 hours, the number has gone up by X
To retrieve data from DB I use:
while($row = mysqli_fetch_array($result))
{
// generating HTML table etc
// echo-ign data with $row['timestamp']
}
My thought was to get the first write in 24 hours and the last write and get the difference, but I am not able to transfer this idea to PHP