How can I display it in pages when there are many article titles in php?
The following is the main code disclosed based on my experience, I hope it will be helpful to beginner netizens.
$page_size=10;(Number displayed on each page)
$sql='select count(*) as rnt from mydbf';
$sql .= ' order by mytime desc ';
$qh=mysql_query($sql);
$data=mysql_fetch_array($qh);
$nr=$data["cnt"];
$pages=intval($nr/$page_size);
if($nr%$page_size) $pages ;
if(empty($page))
{
$page=1;
$offset=0;
}
else
{
$offset=$page*$page_size-$page_size;
}
?>
Page
}
?>