Hi All
I have a simple db table containing fields for ID, Ref # and Image name. The Ref field is NOT a unique key field. Below is my php script. It displays the first record, but as soon as I click on the "next" button, I get the error "Undefined Index: Ref on....."
<?php
error_reporting(E_ALL);
@require_once("scripts/pager.php");
$p = new Pager;
$limit = 1;
$start = $p->findStart($limit);
@require("scripts/connect.php");
$T = $_REQUEST["Ref"];
$count = mysql_num_rows(mysql_query("SELECT * FROM images WHERE Ref = '$T'"));
$pages = $p->findPages($count, $limit);
$result = mysql_query(("SELECT * FROM images WHERE Ref = '$T' LIMIT ".$start.", ".$limit), $connection) or die(mysql_error());
$next_prev = $p->nextPrev($_GET['page'], $pages);
while ($display = mysql_fetch_array($result)) {
$ID=$display["ID"];
$Ref=$display["Ref"];
$Image=$display["Image"];
echo "<p>$next_prev</p>";
echo "<p><img border='0' src='photos/$Image'></p>";
?>
Thnx!
I have a simple db table containing fields for ID, Ref # and Image name. The Ref field is NOT a unique key field. Below is my php script. It displays the first record, but as soon as I click on the "next" button, I get the error "Undefined Index: Ref on....."
<?php
error_reporting(E_ALL);
@require_once("scripts/pager.php");
$p = new Pager;
$limit = 1;
$start = $p->findStart($limit);
@require("scripts/connect.php");
$T = $_REQUEST["Ref"];
$count = mysql_num_rows(mysql_query("SELECT * FROM images WHERE Ref = '$T'"));
$pages = $p->findPages($count, $limit);
$result = mysql_query(("SELECT * FROM images WHERE Ref = '$T' LIMIT ".$start.", ".$limit), $connection) or die(mysql_error());
$next_prev = $p->nextPrev($_GET['page'], $pages);
while ($display = mysql_fetch_array($result)) {
$ID=$display["ID"];
$Ref=$display["Ref"];
$Image=$display["Image"];
echo "<p>$next_prev</p>";
echo "<p><img border='0' src='photos/$Image'></p>";
?>
Thnx!