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); ?>     展示用户列表  
ID 名称 图片 价格 操作
修改 删除
">首页 上一页下一页 ">末页

In this way we have completed the paging effect

Continuing Learning
||
$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); ?> 展示用户列表
ID 名称 图片 价格 操作
修改 删除
">首页 上一页下一页 ">末页
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!