mysqli_pop_connection.php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$db="lipsphpstudent"
// Create connection
$conn = mysqli_connect($servername, $username, $password,$db);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_error());
}
?>
mysqli_pop_select_live_example.php
<?php
include("mysqli_pop_connection.php");
$sql="select id, firstname, lastname from fa_MyGuests";
$query=mysqli_query($sql);
if($query)
{
?>
<?php include('header1.php'); ?>
<?php include("mysql_sidemenu.php"); ?>
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
</thead>
<tbody>
<?php
while($row=mysqli_fetch_array($query))
{
?>
<tr>
<td><?php echo $row['id']; ?></td>
<td><?php echo $row['firstname']; ?></td>
<td><?php echo $row['lastname']; ?></td>
</tr>
<?php
}
}?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php include('footer.php');?>