PHP批量删除jQuery操作
来源:
中文源码网 浏览:292 次 日期:2024-05-12 18:38:47
【下载文档: PHP批量删除jQuery操作.txt 】
PHP批量删除jQuery操作
效果图如下所述:
―>―>―>
―>―>―>
创建视图show.php
header('content-type:text/html;charset=utf-8');
$pdo=new PDO('mysql:host=localhost;dbname=***;','root','root');
$pdo->exec('set names utf8');
$sql='select * from ***';
$info=$pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);
?>
创建adminDel.php
header('content-type:text/html;charset=utf-8');
$str=$_GET['str'];
$pdo=new PDO('mysql:host=localhost;dbname=***;','root','root');
$pdo->exec('set names utf8');
$sql='delete from *** where id in ('.$str.')';
$res=$pdo->exec($sql);
//受影响行数
echo $res;
?>
以上所述是小编给大家介绍的PHP批量删除jQuery操作,希望对大家有所帮助,如果大家有任何疑问欢迎给我留言,小编会及时回复大家的。