取不出SQL得到的當(dāng)前頁
問題描述
//1:定義每條多少頁$page=4;//2:獲取數(shù)據(jù)總條數(shù)$len=sqlsrv_num_rows($result);//3:得到總頁數(shù)$prgeall=(int)ceil($len/$page);//4:獲取當(dāng)前頁$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:數(shù)據(jù)處理//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);
問題解答
回答1:你如果當(dāng)前$_GET['page']取不到值,那就要看看你前端頁面有沒有傳入page這個(gè)值
回答2:數(shù)據(jù)庫用得MSSQL
相關(guān)文章:
1. docker-machine添加一個(gè)已有的docker主機(jī)問題2. python - Pycharm的Debug用不了3. java如何高效讀寫10G以上大文件4. java - 新手求教,當(dāng)前時(shí)間問題?5. apache - nginx 日志刪除后 重新建一個(gè)文件 就打不了日志了6. html - 用ajax提交表單后,返回驗(yàn)證數(shù)據(jù)在頁面location.href跳轉(zhuǎn)到主頁,怎么傳遞session給主頁7. java - tomcat服務(wù)經(jīng)常晚上會(huì)掛,求解?8. node.js - node express 中ajax post請(qǐng)求參數(shù)接收不到?9. 關(guān)于js 字符串 轉(zhuǎn)變成 對(duì)應(yīng)變量10. java - 原生CGLib內(nèi)部方法互相調(diào)用時(shí)可以代理,但基于CGLib的Spring AOP卻代理失效,為什么?
