<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <?php 

   require "database.php";

    $name = $_GET['name'];
    

    $sql = "SELECT * FROM checking
    where  firstname LIKE '%$name%'";

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

if ($results === false) {
  // code...
  echo mysqli_error($conn);
} else {
  // code...
  $viewAttendees= mysqli_fetch_all($results, MYSQLI_ASSOC);



}
 ?>

 
       <?php if (empty($viewAttendees)):?>
         <p>No Absence  found</p>
       <?php else: ?>
       <ul>
         <?php foreach ($viewAttendees as $attendees):  ?>

         <table id="Attendees">
           <tr>
             
           </tr>

           <tr>
             <td><?= $attendees['firstname'] ?></td>
             <td><?= $attendees['lastname'] ?></td>
             <td><?= $attendees['CheckingDate'] ?></td>
           </tr>
         </table>
       <?php endforeach; ?>
       </ul>
     <?php endif; ?>

     <?php
     
  
     ?>
</body>
</html>