i've 30 records in a table... and i wanna to display it based on the number of records in the table... each time 10 records..
the following is my code... is a MESS...!
Code: Select all
<?
//retrieve from table to find how many record inside the table
//and then divide it with 10 to find the total of pages
$num = mysql_query("SELECT ord_id FROM `order` ORDER BY ord_id DESC");
$numrow = mysql_num_rows($num);
$numrow = $numrow/10;
// if the number divide by 10 return 4.1, it will become 5
//so, there will be total of 5 pages
ceil($numrow);
//this is where generate the number of pages required and the link with query strings
$x=10;
$z=0;
for($i=1;$i<=$numrow;$i++) {
echo "<A href="browse2.php?low=$z&high=$x">$i</A>";
$z+=10;
$x+=10;
}
?>Code: Select all
$high=$_REQUEST['high'];
$low=$_REQUEST['low'];
$order = mysql_query("SELECT ord_id FROM `order` ORDER BY ord_id DESC LIMIT $low, $high", $db);do u hv any idea? or u know how to code it? please help me...
thank you~!!!