hello is there a way to create pages of loaded divs from sql? Id like to limit it to 6 per page
I used:
$result = mysqli_query($conn,"SELECT * FROM products ORDER BY ID DESC LIMIT 6");
to limit and I want to display the other ones in next pages.
if(isset($_POST['filter']))
{
$filter = $_POST['filter'];
$result = mysqli_query($conn,"SELECT * FROM products where Product like '%$filter%' or Description like '%$filter%' or Category like '%$filter%'");
}
else
{
$result = mysqli_query($conn,"SELECT * FROM products ORDER BY ID DESC LIMIT 6");
}
if($result){
while($row=mysqli_fetch_array($result)){
$prodID = $row["ID"];
echo '<ul class="col-sm-4">';
echo '<div class="product-image-wrapper">
<div class="single-products">
<div class="productinfo text-center">
<a href="product-details.php?prodid='.$prodID.'" rel="bookmark" title="'.$row['Product'].'"><img src="reservation/img/products/'.$row['imgUrl'].'" alt="'.$row['Product'].'" title="'.$row['Product'].'" width="150" height="150" /></a>
</a>
<h2><a href="product-details.php?prodid='.$prodID.'" rel="bookmark" title="'.$row['Product'].'">'.$row['Product'].'</a></h2>
<h2>₽ '.$row['Price'].'</h2>
<p>Stock: '.$row['Stock'].'</p>
<p>Category: '.$row['Category'].'</p>
<a href="product-details.php?prodid='.$prodID.'" class="btn btn-default add-to-cart"><i class="fa fa-search"></i>View Details</a>
</div>';
echo '</ul>';
}
}
?>
Thank you.