$page=$_GET['page'];
$limit=$_GET['limit'];
$sql="SELECT * from test limit ".($page-1)*$limit.",".$limit;
$q_sql=mysql_query($sql);
$sql2="SELECT * from test";
$q_sql2=mysql_query($sql2);
$count=mysql_num_rows($q_sql2);
$arr=array();
while($res=mysql_fetch_assoc($q_sql)){
$arr[]=$res;
}
$data=array(
'code'=>0,
'msg'=>'',
'count'=>$count,
'data'=>$arr
);
echo json_encode($data);
layui分页php版
最新推荐文章于 2024-07-09 23:16:53 发布