I have a MySQL database table in which I want to store scheduled datetime records.
I'm trying to use PHP date function $schedule = date('Y-m-d H:i:s');
I want to add 1 minute to each record but keep the adding like ++
:
// needed result:
2018-02-08 10:00:00
2018-02-08 10:01:00
2018-02-08 10:02:00
My code looks slimier to this (tried to use stortime but it didn't worked):
$schedule = date('Y-m-d H:i:s');
//$schedule = strtotime('2018-02-18 19:00 + 1 minute');
foreach ($rows as $row) {
$sql = "UPDATE table SET schedule='$schedule'";
$stm = $db->query($sql);
}
Looking for a solution to keep date and time format as described with simple increase by minutes...