in my database table i have up to 1000 entries in a table called product .
In show all product page i have <ul class="produlctlist"></ul>
And there is a script
jQuery(document).ready(function( $ ) {
$.ajax({
method: "POST",
url: "http://example.com/filter.php",
}).done(function( msg ) {
$( ".produlctlist" ).html(msg);
});
});
in filter.php
$query = "SELECT * FROM `product`";
$result = $conn->query($query);
while($row = $result->fetch_assoc()) {
echo "<li><img src='".$row['img']."' />".$row['name']."</li>";
}
Here everything working perfectly . What my question is i need to limit the query as "SELECT * FROM
productLIMIT 45"
and implement pagination or load more for better page speed ? Or no need to limit the query since all details are loaded from jquery ?
Is there any alternative solution available without using pagination or load more ?
For to fetch 1000 data from mysql it take more time than fetch 45 data, then there any way to configured in Jquery that fetch 50 data first , then next 50 data like that ?