Search Posts

Author: Rofhiwa Tumelo Muthivhithi

PHP json_encode function not returning any objects if selecting more than 20 rows of data [duplicate]

This question already has an answer here: php json_encode not working on arrays partially 2 answers include “connectdb.php”; $data = array(); $query = “select * from customer”; $result = $dbhandle -> query($query); if($result->num_rows > 0) { while($row = $result -> fetch_assoc()) { $data[] = $row; } } echo json_encode($data); I have tried to limit to 20 rows and it works but when its more than 20 rows of data it does not return anything. Source: […]