net :: ERR_EMPTY_RESPONSE如何解决

时间:2018-09-28 07:21:20

标签: php ajax

下面给出的我的Ajax代码

它给我类似

的错误
  

net :: ERR_EMPTY_RESPONSE

如何解决错误

setInterval(function(){
    $.ajax({
        url:'count_noti.php',
        type:'POST',
        data:{log_user_noti:'<?php echo $_COOKIE['log_id'];?>' },
        success:function(get_counts){
            console.log(get_counts);
            $('#count_noti').html(get_counts);
            $('#count_noti2').html(get_counts);
        }
    });
},1000);  

服务器端代码

<?php include'conn.php';?>

<?php
    $count_noti="select id,count(*) as cnts 
                from notification 
                where uploader_id in (
                        select accepter from friends 
                        where follower='".$_POST['log_user_noti']."'
                        ) 
                and seen='unseen' 
                or uploader_id in (
                        select follower 
                        from friends 
                        where accepter='".$_POST['log_user_noti']."'
                        ) 
                and seen='unseen' ";
    $count_noti_q=mysqli_query($con,$count_noti);
    while($get_count=mysqli_fetch_array($count_noti_q)):
        echo $get_count['cnts'];
    endwhile;
?>

0 个答案:

没有答案