Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("connection.php");
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Records</title>
- </head>
- <body>
- <h3>Employee Records</h3>
- <?php
- //3. Perform database query
- $result = mysqli_query($con, "SELECT * FROM tblEmployee");
- if(!$result){
- die(mysqli_error());
- }?>
- <table border="1">
- <thead>
- <th>ID</th>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Birthdate</th>
- <th>Gender</th>
- </thead>
- <?php
- //4. Use returned data
- while($row = mysqli_fetch_array($result)){
- ?>
- <tr>
- <td>
- <?php echo $row["empID"];?>
- </td>
- <td>
- <?php echo $row["empFirstName"];?>
- </td>
- <td>
- <?php echo $row["empLastName"];?>
- </td>
- <td>
- <?php echo $row["empDOB"];?>
- </td>
- <td>
- <?php echo $row["empGender"];?>
- </td>
- </tr>
- <?php } ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement