Guest User

Untitled

a guest
Dec 2nd, 2019
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include("connection.php");
  3. ?>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <title>Records</title>
  8. </head>
  9. <body>
  10. <h3>Employee Records</h3>
  11.  
  12. <?php
  13. //3. Perform database query
  14. $result = mysqli_query($con, "SELECT * FROM tblEmployee");
  15.  
  16. if(!$result){
  17. die(mysqli_error());
  18. }?>
  19.  
  20. <table border="1">
  21. <thead>
  22. <th>ID</th>
  23. <th>First Name</th>
  24. <th>Last Name</th>
  25. <th>Birthdate</th>
  26. <th>Gender</th>
  27. </thead>
  28. <?php
  29. //4. Use returned data
  30. while($row = mysqli_fetch_array($result)){
  31. ?>
  32. <tr>
  33. <td>
  34. <?php echo $row["empID"];?>
  35. </td>
  36. <td>
  37. <?php echo $row["empFirstName"];?>
  38. </td>
  39. <td>
  40. <?php echo $row["empLastName"];?>
  41. </td>
  42. <td>
  43. <?php echo $row["empDOB"];?>
  44. </td>
  45. <td>
  46. <?php echo $row["empGender"];?>
  47. </td>
  48. </tr>
  49. <?php } ?>
  50.  
  51. </table>
  52. </body>
  53. </html>
RAW Paste Data