0 and !is_numeric($limit)){ echo "Data Error"; exit; } // If there is a selection or value of limit then the list box should show that value , so we have to lock that options // // Based on the value of limit we will assign selected value to the respective option// switch($limit) { case 1: $select1="selected"; $select10=""; $select5=""; break; } $start=$_GET['start']; if(strlen($start) > 0 and !is_numeric($start)){ echo "Data Error"; exit; } $eu = ($start - 0); if(!$limit > 0 ){ // if limit value is not available then let us use a default value $limit = 1; // No of records to be shown per page by default. } $this1 = $eu + $limit; $back = $eu - $limit; $next = $eu + $limit; /////////////// WE have to find out the number of records in our table. We will use this to break the pages/////// $query2=" SELECT * FROM e107_10most_wanted WHERE Active_id='yes' "; $result2=mysql_query($query2); echo mysql_error(); $nume=mysql_num_rows($result2); /////// The variable nume above will store the total number of records in the table//// /////////// Now let us print the table headers //////////////// $bgcolor="#f1f1f1"; echo "
"; //echo ""; ////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page/////////// $query=" SELECT * FROM e107_10most_wanted WHERE Active_id='yes' ORDER BY Stamp_id ASC limit $eu, $limit "; $result=mysql_query($query); echo mysql_error(); //////////////// Now we will display the returned records in side the rows of the table///////// while($noticia = mysql_fetch_array($result)) { $showimage="http://www.parkstamps.org/e107_plugins/10most_wanted/images/photo/$noticia[Image_id]"; if($bgcolor=='#f1f1f1'){$bgcolor='#ffffff';} else{$bgcolor='#f1f1f1';} echo ""; echo ""; echo ""; } echo "
     UNIT | LOCATION IN UNIT
 $noticia[Text_id]
"; ////////////////////////////// End of displaying the table with records //////////////////////// /////////////// Start the buttom links with Prev and next link with page numbers ///////////////// echo "
"; //// if our variable $back is equal to 0 or more then only we will display the link to move back //////// if($back >=0) { print "PREV"; } //////////////// Let us display the page links at center. We will not display the current page as a link /////////// echo ""; $i=0; $l=1; for($i=0;$i < $nume;$i=$i+$limit){ if($i <> $eu){ echo " $l "; } else { echo "$l";} /// Current page is not displayed as link and given font color red $l=$l+1; } echo ""; ///////////// If we are not in the last page then Next link will be displayed. Here we check that ///// if($this1 < $nume) { print "NEXT";} echo "
"; ?>
Wanted Poster Image