/* this is an example which splits the query results into multiple pages as search engine does
you can change the query and format in which the result is being printed
*/
include("split.class.php3");
$sql="select * from TABLE"; //query
$ord=new Split($sql,10); //create an object of split pass the sql and total no of rows to
be displayed in a page
if($ord->error!="")
{
die("ERROR" . $ord->error);
}
$rows=$ord->display($ppage);
$pages=$ord->total(); //get the total no of pages
while($myrow=mysql_fetch_row($rows))
{
//print the results over here
printf("Name is $myrow[0]<br>"); //this is just a test value
}
//*************************************************************************
******************
// now the links to other pages will be displayed with back and next
//*************************************************************************
*******************
if(($ppage=="")||($ppage<="0") )
{
$ppage=1; //as default if the requested page is less than 0 the first page
is printed
}
if($ppage > $pages)
{
$ppage=$pages; //if the requested page is greater than total pages the last page
is shown
}
if($ppage>1)
{
$backpage=$ppage-1;
printf("<a href=example.php3?ppage=$backpage>Back</a> ");