I am like to view the data retrieved by the SQL statement but when doing it only
json_response display the data but what I want to see is echo json_encode($json_response) format of data.
I follow this tutorial but did not get the same result.
json_encode($json_response) shows no data AKA plain screen
http://www.webslesson.info/2016/05/convert-data-from-mysql-to-json-formate-using-php.html
$query = "SELECT * from LibraryEvents";
$result = mysqli_query($connDB,$query);
$json_response = array();
while($row = mysqli_fetch_assoc($result)) {
$json_response[] = $row;
//array_push($json_response,$row_array);
}
echo '<pre>';
print_r($json_response);
echo '<pre>';
echo json_encode($json_response);