Home >Backend Development >PHP Tutorial >Simple and easy-to-understand modern magic animation. PHP introductory learning knowledge point 2. PHP simple paging process and principle
require '../inc/conn.php';
?>
//Initial parameter settings
$pagesize=5; //Page size
$pagenum=1; // The default is the first page
//Step 1: Get the current page
if($_GET){
if($_GET['pagenum']){
$pagenum=$_GET['pagenum'];
}
}
//Step 2: Get the content list of the current page
$sql="Select * From message limit ".($pagenum-1)*$pagesize.",$pagesize ";
$result=mysql_query( $sql);
while(($row=mysql_fetch_array($result))==true){
echo '
The above introduces the simple and easy-to-understand modern magic animation PHP entry-level learning knowledge point 2. The simple paging process and principles of PHP, including the simple and easy-to-understand content of modern magic animation. I hope it will be helpful to friends who are interested in PHP tutorials.