C
Cathy V
Guest
I want to write a php script that displays 10 results per page and allow user to navigate through the resul pages.
$data=mysql_query("SELECT * FROM tablename ")
//number of results(rows)
$rows=mysql_num_rows()
//number of pages
$pages=$rows/10
if $rows % 10!=0, $pages=$pages+1
//the php script( I want it as simple as possible)
with this layout, what script should i write to generate a navigation menu to display number of pages
- page 1( link "1") showing results LIMIT 0 10;
-page 2( link "2") showing results LIMIt 10 10;
-page 3 ( link "3")showing results LIMIT 20 10 etc...
-last page showing modulus of $row % 10
Many thanks for your invaluable help
$data=mysql_query("SELECT * FROM tablename ")
//number of results(rows)
$rows=mysql_num_rows()
//number of pages
$pages=$rows/10
if $rows % 10!=0, $pages=$pages+1
//the php script( I want it as simple as possible)
with this layout, what script should i write to generate a navigation menu to display number of pages
- page 1( link "1") showing results LIMIT 0 10;
-page 2( link "2") showing results LIMIt 10 10;
-page 3 ( link "3")showing results LIMIT 20 10 etc...
-last page showing modulus of $row % 10
Many thanks for your invaluable help