I want to assign multiple vehicles in one reservation if i click the add button. Here is my code;
if(isset($_REQUEST['cid']))
{
$cid=intval($_GET['cid']);
$tid=intval($_GET['tid']);
$sql = "UPDATE tblbooking SET VehicleId=:cid WHERE id=:tid";
$query = $dbh->prepare($sql);
$query -> bindParam(':cid',$cid, PDO::PARAM_STR);
$query -> bindParam(':tid',$tid, PDO::PARAM_STR);
$query -> execute();
$msg ="Vehicle Successfully Assigned. ";
}
I tried INSERT INTO but I am not going anywhere.Does anyone know how to revise this code? I want my output to be like this;
|booking_id|VehicleId|
----------------------
|1 |1 |
|1 |2 |
----------------------