What is the best way to add to a datetime type column in mysql database? I tried using DATE_ADD but it only works when I add single date/time like:
DATE_ADD(start_date, INTERVAL :dayCount DAY)
This does NOT Work:
DATE_ADD(DATE_ADD(start_date, INTERVAL :dayCount DAY), INTERVAL :hourCount HOUR)
I tried adding microseconds as suggested by some:
$startMicro = strtotime($startDiff->format("%Y-%m-%d %H:%i:%s")) * 1000; // 943920000000
start=DATE_ADD(start, INTERVAL :startMicro MICROSECOND)
I DID THIS IN THE END AND IT WORKS: in PHP: $minutesDiff = (strtotime($start) - strtotime($row->start)) / 60; in SQL STATEMENT: start=DATE_ADD(start, INTERVAL :minutesDiff MINUTE)
Thanks all for the help.