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

    require 'database.php';

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

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

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

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

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


  }

   ?>