//Connect to the database
$db=mysql_connect("localhost","root","");
mysql_select_db("hy",$db);
//Set the number of records displayed on each page
$pagesize=25;
//Get the total number of records and calculate the total number of pages
$res=mysql_query("select count(*) from main numrows/$pagesize); page))
$page=1;
//Judge the number of pages to go to
if (isset($ys))
if ($ys>$pages)
$page=$ pages;
else
$page=$ys;
//Calculate the record offset > $res=mysql_query("select id,title from main order by id desc limit $offset,$pagesize" ,$db);
//Loop display of records
if ($myrow = mysql_f etch_array($res) )
{ $i=0;
?> >
|
Content |
do $i++; td> id=')" >
}
while ($myrow = mysql_fetch_array($res));
echo "" ;
//Display the total number of pages
echo "
There are ".$pages." pages (".$page."/".$pages.")
Page ".$i ." " ";
echo ".$page."Page "; $i<=$pages;$i++)
echo "
Page ".$i ." " ;
echo "
";
//Show the page number
echo "
";
echo "
";
?>
http://www.bkjia.com/PHPjc/318881.html
www.bkjia.com
true