<?php
  if ($_SERVER["REQUEST_METHOD"] == "POST") {

    require '../includes/db.php';

    $current_date = date("Y-m-d");
    // code...
    $name = $_POST['name'];
    $date =$_POST['date'];

    $sql = "UPDATE `checking` SET 
    `CheckingOut` = '$date' WHERE 
    `checking`.`CheckingName` = '$name'
     AND `checking`.`CheckingDate` = '$date';";
    // $sql = "UPDATE `childrencheckin` SET `checkout` = '2024-09-2' WHERE `childrencheckin`.`childrenCheckinID` = 60;";
             

    $results = mysqli_query($con, $sql);

    if ($results === false) {
      echo mysqli_error($con);
    } else {

      $id = mysqli_insert_id($con);
       echo "successfully check out with $id";
    }


  }

   ?>