Unable to retrieve the current page obtained by SQL
fgg
fgg 2021-07-23 19:11:37
0
2
1051
//1:定义每条多少页
$page=4;
//2:获取数据总条数
$len=sqlsrv_num_rows($result);
//3:得到总页数
$prgeall=(int)ceil($len/$page);
//4:获取当前页
$dpage=$_GET['page']?? 1;

//5:处理上一页
$prepage=$dpage-1<=1?1:($dpage-1);

//6:处理下一页
$nextpage=$dpage +1>=$prgeall ? $prgeall:($dpage+1);
//$num=($dpage-1)*$page;
//7:数据处理

//mssql_data_seek($result,($dpage-1)*$page);
//$offset=($dpage-1)*$page;
//$start = $offset;
//$pagesize = $page;
//$sqls = "select top $pagesize o.*from ($result) as o where id not in(select top $start id  from ($result) as oo order by id asc) order by id asc" ;

//$result=array_slice($result,$num,$page,true);

fgg
fgg

reply all(2)
逆旅行人

If you cannot get the value of $_GET['page'] currently, then you need to check whether your front-end page has passed in the value of page

fgg

The database uses MSSQL

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template