<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>View all Guests</title>
  <link rel="stylesheet" href="tableview.css">
  <!--<link rel="stylesheet" href="main.css">
  <link rel="stylesheet" href="form.css"> -->
</head>
<body>
<?php
require 'db.php';





// echo "Haha.. Connected successfully";
$sql = "SELECT *
FROM children
" ;

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


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



}
 ?>

  <?php require 'header.php'; ?>
       <?php if (empty($viewChildren)):?>
         <p>No Children found</p>
       <?php else: ?>
       <ul>
         <?php foreach ($viewChildren as $children):  ?>

         <table id="Children">
           <tr>
             <th>First Name</th>
             <th> Last Name</th>
             <th> Date of Birth</th>
           </tr>

           <tr>
             <td><?= $children['ChildrenFirstName'] ?></td>
             <td><?= $children['ChildrenLastName'] ?></td>
             <td><?= $children['ChildrenDateOfBirth'] ?></td>
           </tr>
         </table>
       <?php endforeach; ?>
       </ul>
     <?php endif; ?>

     <?php require 'footer.php' ?>

</body>
</html>


