I have a mysql database like this
---------------------------------------------------------------------------
| startdate | starttime | enddate | endtime | status |
---------------------------------------------------------------------------
| 2020-03-04 | 04:30:00 | 2020-03-04 | 09:00:00 | running |
| 2020-03-04 | 11:30:00 | 2020-03-04 | 19:30:00 | running |
| 2020-03-05 | 05:00:00 | 2020-03-05 | 11:15:00 | running |
| 2020-03-05 | 12:30:00 | 2020-03-05 | 22:08:00 | running |
---------------------------------------------------------------------------
I want know if is possible, create a php(or something like that) script to insert all intervals between date/time and create a row with status “stopped”.
Example:
---------------------------------------------------------------------------
| startdate | starttime | enddate | endtime | status |
---------------------------------------------------------------------------
| 2020-03-04 | 00:00:00 | 2020-03-04 | 04:30:00 | stopped | *created by this script
| 2020-03-04 | 04:30:00 | 2020-03-04 | 09:00:00 | running |
| 2020-03-04 | 09:00:00 | 2020-03-04 | 11:30:00 | stopped | *
| 2020-03-04 | 11:30:00 | 2020-03-04 | 19:30:00 | running |
etc.
---------------------------------------------------------------------------
Is this possible?
Sorry my english