=$maxRows){ $offset=$_GET['offset']; } } if($_GET['action']=='bottom'){ if($maxRows%$rowsOfPage==0){ //整页 $offset=$maxRows-$rowsOfPage; }else{ //非整页 $offset=$maxRows-$maxRows%$rowsOfPage; //20 10 20-10 25-25%10 20 } } }else{ //第一次进入,偏移量为0 $offset=0; } $queryString="select * from user_70 limit $offset,$rowsOfPage"; $rs=mysqli_query($link,$queryString); //用循环语句,从数据集中读出每一条记录 echo "
姓名列表 | "; $pattern = '/(\d+)/'; while ($row=mysqli_fetch_assoc($rs)){ preg_match_all($pattern, $row['name'], $matches); echo "|||||||||
".($matches[0][0]+1)." | "; echo "".$row['name']." | "; } echo "||||||||
首页 | 上一页 | 下一页 | 末页 |