require_once("admin/connect_db.php"); ?> @ $rpp; //Records Per Page @ $cps; //Current Page Starting row number @ $lps; //Last Page Starting row number @ $a; //will be used to print the starting row number that is shown in the page @ $b; //will be used to print the ending row number that is shown in the page if(empty($_GET["cps"])) { $cps = "0"; } else { $cps = $_GET["cps"]; } $a = $cps+1; $rpp = "15"; $lps = $cps - $rpp; //Calculating the starting row number for previous page if ($cps <> 0) { $prv = ""; } else { $prv = " "; } $q="Select SQL_CALC_FOUND_ROWS * from imageteb limit $cps, $rpp"; $rs=mysql_query($q) or die(mysql_error()); $nr = mysql_num_rows($rs); //Number of rows found with LIMIT in action $q0="Select FOUND_ROWS()"; $rs0=mysql_query($q0) or die(mysql_error()); $row0=mysql_fetch_array($rs0); $nr0 = $row0["FOUND_ROWS()"]; //Number of rows found without LIMIT in action if (($nr0 <1) || ($nr <3)) { $b = $nr0; } else { $b = ($cps) + $rpp; } ?>
|