'$prdid' AND sub_cat_id = '$subcatid' AND publish = 'y' order by prdid limit 1") or die(mysql_error()); if($inf = mysql_fetch_array($sql1)){ // A next record is found $next = $inf["prdid"]; // Set $id to the next ID }else { $nonext = 0; } //below is previous record in mysql $sql1 = mysql_query("select prdid from products where prdid < '$prdid' AND sub_cat_id = '$subcatid' AND publish = 'y' order by prdid desc limit 1") or die(mysql_error()); if($inf2 = mysql_fetch_array($sql1)){ // A previous record is found $previous = $inf2["prdid"]; // Set $id to the previous ID }else { $noprevious = 0; } // print_r($total_p_ar); // getting end product $end_id = end($total_p_ar); // getting First product $first_id = $total_p_ar[0]; ?> Untitled Document

PBE-


 Quantity:   *

  First Product qwe Previous Product Previous Product
/
Next  Product Next Product qew Last Product