搜尋分頁刪除

2021-07-24 20:30:41 字數 1157 閱讀 8050

<?php

header("content-type:text/html;charset=utf-8");

mysql_connect("127.0.0.1","root","root");

mysql_select_db("js");

mysql_query("set names utf8");

$uname=isset($_get['uname'])?$_get['uname']:'';

$sql="select * from fenye";

$res=mysql_query($sql);

//總記錄數

$total=mysql_num_rows($res);

//設定每頁顯示的條數

$pagenum=5;

//計算共多少頁

$pagetotal=ceil($total/$pagenum);

//設定當前頁

$page=isset($_get['page'])?$_get['page']:1;

$up=$page-1<1?1:$page-1;

$down=$page+1>$pagetotal?$pagetotal:$page+1;

//偏移量

$limit=($page-1)*$pagenum;

$sql="select * from fenye limit $limit,$pagenum";

$res=mysql_query($sql);

?>

"/>

全選編號

使用者名稱操作

<?php

while($row=mysql_fetch_assoc($res))

?>

反選)">批量刪除

首頁)">尾頁

第<?php echo $page; ?>頁

共<?php echo $pagetotal; ?>頁

)">

編號使用者名稱

操作<?php

while($row=mysql_fetch_assoc($res))

?>

反選1)else; ?>)">批量刪除

首頁)">尾頁

第<?php echo $page; ?>頁

共<?php echo $pagetotal; ?>頁

)">

原聲搜尋分頁刪除

header content type text html charset utf 8 mysql connect 127.0.0.1 root root mysql select db js mysql query set names utf8 uname isset get uname get ...

分頁,搜尋後保留搜尋條件分頁

先寫乙個簡單的分頁,供初學者參考 header content type text html charset utf8 建立乙個資料來源,若資料來自於mysql 此處請改為mysql獲取資料 注意limit使用 limit offset,length offset 為偏移量,從第幾個開始 下標從0開...

全 反選 批量刪除 搜尋 無重新整理分頁

姓名 請選擇性別男女 姓名性別 簡介操作 v 刪除 修改 批量刪除 defined basepath or exit no direct script access allowed class welcome extends ci controller else print r data exit ...