What I want is to update the arrival date of my reservations table by adding one day to it. What I tried is the following:
$reservationId=$_GET['reservationId'];
$getArrivaldate="SELECT arrival_date from reservations WHERE reservation_id=$reservationId;";
$getArrivalResult=mysqli_query($conn,$getArrivaldate);
$rowArrivalDate=mysqli_fetch_array($getArrivalResult);
$arrivalDate=$rowArrivalDate['arrival_date'];
$newArrivalDate=date('Y-m-d',strtotime($arrivalDate . "+1 days"));
$noShowReservation="UPDATE reservations SET $arrivalDate = $newArrivalDate WHERE reservation_id=$reservationId ;";
if(mysqli_query($conn,$noShowReservation))
{
header("Location:../public/home.php?reservation=moved");
exit();
}
else{
echo"ERROR";
}
But when I excecute the query on xammp I get the error "#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''2021-02-05' = '2021-02-06' WHERE reservation_id=104' at line 1".. What am I missing here ?