There is a page that displays a grid of images that are stored in the folder, and are displayed on the page thanks to the MySQL query, where the paths to the images are stored.
It is necessary to make pagination with these images. That, say, on the first page 40 images were displayed and on subsequent pages as well. How can I do that?
<?php $img_url = "uploads/"; $result = mysql_query("SELECT images.id as imgid, images.image_name, images.user_id_fk, users.id, users.login FROM images,users WHERE images.user_id_fk = users.id ORDER BY images.created ".$sort); while($row = mysql_fetch_assoc($result)) { echo ' <div class="column is-one-quarter container1"> <a href="img.php?img='.$row['imgid'].'"> <figure class="image image is-square"> <img style="object-fit: cover; cursor: pointer;" src="'.$img_url.$row['image_name'].'" /> </figure> <div class="overlay"> <div class="text">'.$row['login'].'</div> </div> </a> </div> '; } ?>
LIMITstatement in the request - teran