douxi3085 2018-06-28 10:18
浏览 50

空白页面即将进行SQL提取

I am unable to get any output from the database. There are around 13000 entries in my database. However when I am trying to limit the result by 350 then the output is there but when i remove the limit then a blank page is coming. Also when i am fetching other columns then all 13000 queries are being returned.What to do now?

<?php

$servername = "localhost:3306";
$username = "root";
$password = "mypassword";
$database = "mydatabase";

$conn = new mysqli($servername, $username, $password, $database);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$info = array(); 


$sql = "SELECT Customer_Name FROM enquiry ;";


$stmt = $conn->prepare($sql);


$stmt->execute();


$stmt->bind_result($Customer_Name);


while($stmt->fetch()){

array_push($info, $Customer_Name);
}




echo json_encode($info);
?>
  • 写回答

1条回答 默认 最新

  • doute7910 2018-06-28 10:24
    关注

    you need to free up the result after process. try this format so that you can get error message too.

    $execute=mysql_query($sql,$conn);
     if (!$execute) {
         die "Query ($sql) failed: " . mysql_error();
     }
     while ($row=mysql_fetch_assoc($execute)) {
        /* loop through a result set even if you don't think you need to. */
        print_r($row);
     }
     mysql_free_result($execute);
    

    Also check for max_allowed_packet in SQL.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题