I have read multiple stack overflow answers but still cant find one specific to my needs. Some are outdated. I am using bootstrap and I want to display the first set of records which I am doing by using 'LIMIT 9'. I just have no idea how to get the next 10 records and every 10 records after that to display once the link at the bottom has been clicked. I don't want to open a new page for every 10 records.
`<div class="container-fluid">
<div class="row row-fluid">
<div class="col-xs-12 col-sm-12 col-md-8 offset-md-2 col-lg-8 offset-lg-2">
<h2>List of current Database entries</h2>
<?php
$servername = "localhost";
$username = "xxxxx";
$password = "xxxxxx";
$dbname = "xxxxxxxxx";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT id, business_name, email, website, phone FROM table LIMIT 0, 9";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table class='table table-striped'>";
echo "<thead>";
echo "<tr>";
echo "<th>ID</th><th>Business Name</th><th>Email</th><th>Website</th><th>Phone</th>";
echo "</tr>";
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>"."id : ". $row["id"]."</td>
<td>".$row["business_name"]."</td>
<td>".$row["email"]."</td>
<td>".$row["website"]."</td>
<td>".$row["phone"]."</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
<a href="#" class="more">Next 10</a>
</div>
</div>
</div>
That is what I have so far. I would really appreciate some help
This image shows how it looks nowimage of how it looks I dont want people to leave the page for the results. Thank you.