以下php脚本可以正常工作,如果我在我的MYSQL表上运行少于200条记录,但如果记录数超过200,则返回一个空白屏幕。请帮忙。
<?php
$host='localhost';
$username='user';
$pwd='pass';
$db='myDB';
$con=mysqli_connect($host,$username,$pwd,$db) or die('Unable to connect');
if(mysqli_connect_error($con))
{
echo "Failed to Connect to Database ".mysqli_connect_error();
}
$sql='SELECT * FROM MyTable';
$result=mysqli_query($con,$sql);
if($result)
{
while($row=mysqli_fetch_array($result))
{
$data[]=$row;
}
print(json_encode($data));
}
mysqli_close($con);
?>