It works fine for less no of rows, but returns nothing after result increased to 8000 rows
<?php
require("db_config.php");
$con=mysqli_connect($DB_SERVER,$DB_USER,$DB_PASSWORD,$DB_DATABASE);
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql = "SELECT stop_id, stop_code, stop_name from stops";
$result = mysqli_query($con, $sql);
echo $sql . mysqli_num_rows($result);
if(mysqli_num_rows($result) > 0) {
$response["stopnames"] = array();
while ($row = mysqli_fetch_array($result)) {
$item = array();
$item["stop_id"] = $row["stop_id"];
$item["stop_code"] = $row["stop_code"];
$item["stop_name"] = $row["stop_name"];
// push ordered items into response array
array_push($response["stopnames"], $item);
}
// success
$response["success"] = 1;
$response["msg"] = $sql;
}
else
{
// order is empty
$response["success"] = 0;
$response["msg"] = $sql;
}
// echoing JSON response
echo json_encode($response);
mysqli_close($con);
?>
Result: SELECT stop_id, stop_code, stop_name from stops7618 indicates, some 7618 rows fetched, but no result returns It works fine for some less no of rows in result
Maybe your script terminated due to maximum execution time or memory limit.
In begin add
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
After echo json_encode($response) add something like
echo 'Stoped';
And check if it will be output