#---------------------------------------database configuration
$db_user = "root";
$db_pass = "pass";
$db_name = "phpMember";
$db_host = "localhost";
mysql_pconnect($db_host, $db_user, $db_pass) or die("Unable to connect to SQL server");
mysql_select_db($db_name) or die("Unable to select database");
#---------------------------------------page scroller configuration
$script="scroller2.php3";
$offset+=0;
$item_perpage= 2; #----change this to define how many item per page
$prev= $offset-$item_perpage;
$next= $offset+$item_perpage;
#---------------------------------------query configuration
$tbl_search = "country";
$field="name ";
$query="SELECT $field FROM $tbl_search WHERE $field LIKE '%$keyword%' LIMIT $offset, $item_perpage";
$querytotal="SELECT count(*) FROM $tbl_search WHERE $field LIKE '%$keyword%'";
$total=mysql_fetch_row(mysql_query($querytotal));
#----modify the where clause to fit your query need
#---------------------------------------prev next condition
if ($prev < 0) {$prev="";}
else {$prev="<< PREV";}
if ($total[0] > $next) {$next="NEXT >>";}
else {$next="";}
?>
Page Scroller
Query:
to of
#---------------------------------------query process
$data=mysql_query($query);
$no=1;
while ($result=mysql_fetch_array($data)) {
?>
NO: .
$no++;
}
#---------------------------------------page scroller
?>