I wanna save and store date format from $interval in database column which have dattime type. But its not work, in database not show that value.
if ($no > 1){
$startdate = new DateTime($lup[$no]);
$enddate = new DateTime($lup[$no-1]);
$int = $startdate->diff($enddate);
$interval = $int->format("%d days, %h hours, %i minutes, and %s seconds ");
echo "<td>".$interval." </td>";
}else
{
echo "<td> --- </td> ";
}
if ($data['id'] == 2){
$sql = mysql_query("
INSERT INTO sla (booking_id, approval)
VALUES ('$booking_id[$no]', '$interval')")
;}