prepare("deletefromnasztwhere1=1andid"/>
PHP头条
热点:

请教大神,这样写,php的查询是否是执行了两次


请问大神,这样写,php的查询是否是执行了两次?

$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 "《script》";
echo "$(function() {";
echo  "$('.del').click(function() {";
echo  " $('#'+$(this).attr('id')).remove()";
echo  "})";
echo "})";
echo "《script》";
 }else{
echo  '《script》alert("由于网络原因,删除失败,请重试!");《script》';
  }
}
?>
$selectSpecialContent=$dbc->prepare("select * from naszt");
$selectSpecialContent->execute();
?>


专题名称
专题类型
发表时间
发表ip
操作


fetch()){ ?>
">




">" >删除




请问大神,这样写,php的查询是否是执行了两次?


$(function() {
  $('.del').click(function() {
    $('#'+$(this).attr('id')).remove();
  });
});
《script》
这段js就是删除当前的tr,但是我觉的$selectSpecialContent=$dbc->prepare("select * from naszt");
$selectSpecialContent->execute(); 这句SQL查询又被执行了一次 分享到: 更多

相关文章

相关频道:

PHP之友评论

今天推荐