I have a page of images which are showing in a main template window. I need to add pagination to them as their is over 900 images. I have this working but it is not paginating although it is showing in the URL. I have set a session should I have used that instead of the url. It is showing the two links although I still need to format them with images and as I mentioned it is showing the number increases and decreases by 32 in the browser address but the images are not changing? Any consideration and assistance would be greatly appreciated.
Here is my code.
<?PHP session_start();
include 'php-bin/dbConn.php';
//Count Number of Rows
$sql_get_gallery_photo_info = ("SELECT * FROM AL_gallery_images ORDER BY uploadDate DESC LIMIT $startrow 32");
$result = mysql_query($sql_get_gallery_photo_info) or die('Could not query:' . mysql_error());
//Begin pagination check if the starting row variable was passed in the URL or not
if (!isset($_GET['startrow']) or !is_numeric($_GET['startrow'])) {
//we give the value of the starting row to 0 because nothing was found in URL
$startrow = 0;
//otherwise we take the value from the URL
} else {
$startrow = (int)$_GET['startrow'];
}
//this part goes after the checking of the $_GET var
//$sql_get_gallery_photo_info = mysql_query("SELECT * FROM AL_gallery_images LIMIT $startrow, 32") or die(mysql_error());
while ($rows = mysql_fetch_array($result)) {
$records[] = array(1 => $rows['imageName']);
$userIDs[] = array(1 => $rows['userID']);
}
?>