Hi. I am trying to make data print with next/previous links, but with a twist. The code below works, except I need to print results that are specific to one row of the db, and the variable is pid (meaning pid is the product id number that is selected to view warranty info on). I need the next/previous links because if the data on that products warranty is longer than will fit into my popup window, I need to show a "next" link to the next page of the data. It will be like splitting a story in half, with the first half on the first page and the second half on the second. I hope this is making sense. Thanks.
<?php
include "configgg.php";
if (isset($hostname) and isset($database) and isset($db_login) and isset($db_pass)) {
$dbconn = mysql_connect($hostname, $db_login, $db_pass) or die("Could not connect");
mysql_select_db($database) or die("Could not select database");
$perPage=1;
$start=isset($HTTP_GET_VARS['s'])?$HTTP_GET_VARS['s']:0;
$total_rows=isset($HTTP_GET_VARS['t'])?$HTTP_GET_VARS['t']:'';
$PHP_SELF=isset($HTTP_SERVER_VARS['PHP_SELF'])?$HTTP_SERVER_VARS['PHP_SELF']:'';
if(!$total_rows)
list($total_rows)=mysql_fetch_row(mysql_query('select count(*) from product_status'));
$result=mysql_query("select warranty from product_status limit $start,$perPage");
while ($data=mysql_fetch_assoc($result))
echo $data['warranty];//output data here
$startP=$start-$perPage;
echo $startP>=0? "<br><br><a href='$PHP_SELF?t=$total_rows&s=$startP'>PREV</a> | " : 'PREV ';
$startN=$start+$perPage;
echo $startN<$total_rows ? "<a href='$PHP_SELF?t=$total_rows&s=$startN'>NEXT</a> " : 'NEXT ';
mysql_close($dbconn);
}
?>