php增删改查
2021-04-10 03:33
阅读:520
YPE >
标签:nbsp date 多少 put initial soc ice jquery device
html>
.adc {
color: red;
}
// 分页
if (isset($_GET[‘page‘])) {
$p = $_GET[‘page‘];
} else {
$p = 1;
};
$pagenum = 2;
$pages = ($p - 1) * $pagenum;
$page = $pages . ‘,‘ . $pagenum;
// p标签查询条件
$where = "";
$tit ="";
if(isset($_GET[‘tit‘])){
$tit = $_GET[‘tit‘];
$where = "where title like ‘%$tit%‘";
}
//
$conn = new mysqli(‘localhost‘, ‘root‘, ‘root‘, ‘aaa‘);
$sql = "select * from chanpinbiao $where $where limit $page";
$res = $conn->query($sql);
$arr = $res->fetch_all(MYSQLI_ASSOC);
// 查询所有数据
$sql = "select * from chanpinbiao $where";
$ree = $conn->query($sql);
$zu = $ree->num_rows;
// 分多少页
$zui = ceil($zu / $pagenum);
$conn->close();
?>
请输入内容:">
id | 标题 | 图片 | 内容 | 操作 |
1) { ?>
}
for ($i = 1; $i
?>
};
if ($zui > $p) {
?>
}
?>
$(‘.del‘).click(function() {
var i = confirm(‘确定删除?‘);
var ids = $(this).attr(‘tt‘);
var thid = $(this);
if (i == true) {
$.ajax({
url: der.php,
date: {
‘id‘: ids
},
dataType: ‘json‘,
type: ‘post‘,
success: function(res) {
if (res.code == 1) {
this.parents(‘tr‘).remove();
} else {
alert(‘服务器异常,稍后再试‘);
}
}
})
};
});
php增删改查
标签:nbsp date 多少 put initial soc ice jquery device
原文地址:https://www.cnblogs.com/wangzihao147/p/12434671.html
评论
亲,登录后才可以留言!