現在選択されている時間と計算された時間の2つの値をデータベースに挿入したい。基本的に、このように。「7:00AM - 10:00AM」が現在のコードです。データベースに空白を挿入します。
$date = new DateTime($res_dur);
$date->add(new DateInterval('PT3H'));
$date->format('H:i:s');
$ndate = $_POST[$res_dur][$date];
$query = "INSERT INTO tbl_reservation(
res_no,cust_id,pack_type,plan_id,res_date,res_dur,
res_venue,pack_choice,date_app,add_ons,res_comm)
VALUES
('','{$cust_id}','{$pack_type}','{$plan_id}','{$res_date}','{$ndate}',
'{$res_venue}','{$pack_choice}',CURDATE(),'','')";
$result_set = mysql_query($query);
if ($result_set) {
echo "<script language=javascript>alert('You have been successfully registered!')</script>";
header("Location:home.php");