Displaying records from a MySQL Database with PHP

<!DOCTYPE html>
<html>
<head>
<title>View Records</title>
</head>
<link rel="stylesheet" type="text/css" href="assets/libs/bootstrap/css/bootstrap.css">

<script type="text/javascript" src="assets/libs/bootstrap/js/bootstrap.js"></script>

<body>
<header>
<?php include 'shared/header.html'; ?>
</header>

<?php
include 'db.php';
$query = "SELECT * from maid_info";
$result = mysqli_query($conn,$query) or die(mysqli_error());


?>
<table class="table">
    <tr>
        <th>ID</th>
        <th>First Name</th>
        <th>Middel Name</th>
        <th>Last Name</th>
        <th>Gender</th>
        <th>Phone No</th>
    </tr>
    <?php
        while ($record = mysqli_fetch_assoc($result)) {
            echo "<tr>" ;

            echo "<td>".$record['mid']."</td>";

            echo "<td>".$record['mfname']."</td>";

            echo "<td>".$record['mmname']."</td>";

            echo "<td>".$record['mlname']."</td>";

            echo "<td>".$record['mg']."</td>";

            echo "<td>".$record['pno']."</td>";

            echo "</tr>";
        }
    ?>
</table>
<script type="text/javascript" src="assets/js/jquery-3.1.0.js"></script>
</body>
</html> 
Previous
Next Post »

Disqus Shortname

Comments system