Product display of PHP development corporate website tutorial (2)
In the previous course, we have completed the paging effect of news
So we can copy the paging code in the previous section and then change the table name
The code is as follows :
$total_page ? $total_page:$page;//当下一页数大于最大页数时的情况 //分页设置初始化 $start=($page-1)*$perpage; $sql = "SELECT * from product order by id desc limit $start,$perpage"; $info = mysql_query($sql); //$sql = "select * from product order by id desc"; //查询user表中的数据 //$info = mysql_query($sql); ?>展示用户列表
In this way we have completed the paging effect