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

    require 'database.php';

    $current_date = date("Y-m-d");
    // code...
    $sql = "INSERT INTO checking (firstname, lastname, CheckingDate, CheckingIn)
              VALUES ('" . mysqli_escape_string($conn, $_POST['firstname']) . "', '"
                           . mysqli_escape_string($conn, $_POST['lastname']) . "', '"
                          . mysqli_escape_string($conn, $_POST['CheckingDate']) . "','"
                          . mysqli_escape_string($conn, $_POST['CheckingIn']) . "')";


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

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

      $id = mysqli_insert_id($conn);
       echo "Successfully check IN";
    }


  }

   ?>