$act=$_GET['act'];
$id=$_GET['id'];
switch($act){
case "del";
$del=$dbc->prepare("delete from naszt where 1=1 and id=?");
if($del->execute(array($id))){
echo "";
}else{
echo '';
}
}
?>
$selectSpecialContent=$dbc->prepare("select * from naszt");
$selectSpecialContent->execute();
?>
| 专题名称 | 专题类型 | 发表时间 | 发表ip | 操作 |
|---|---|---|---|---|
请问大神,这样写,php的查询是否是执行了两次?
这段js就是删除当前的tr,但是我觉的$selectSpecialContent=$dbc->prepare("select * from naszt");
$selectSpecialContent->execute(); 这句SQL查询又被执行了一次 分享到:
------解决方案--------------------
从头到尾只有一次查询操作,就算你执行删除操作,那也是一次查询操作。如果你删除的时候不想执行查询下面的内容,那你就要使用ajax 来操作了