My main goal is to create a Pagination with photo thumbnails. I have successfully managed to create my own pagination. But the problem is, I know how to use ajax, I just don't know how to apply ajax to it so that it is more user friendly. Can someone help me out, I have been struggling to find an answer to this problem. Below is my code.
<?php
require 'php/connect.inc.php';
$per_page = 3;
$pages_query = mysql_query("SELECT COUNT('id') FROM my_list");
$pages = ceil(mysql_result($pages_query, 0) / $per_page);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$query = mysql_query("SELECT id, image_small FROM my_list LIMIT $start, $per_page");
while($mysql_fetch_assoc = mysql_fetch_assoc($query)){
echo "<img src=".'img/uploads/'.$mysql_fetch_assoc['image_small'].">";
}
if ($pages >= 1 && $page <= $pages){
for ($x=1; $x <= $pages; $x++){
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a>';
}
}
?>