I'm working on Android apps that showing the output of table in SQL from PHP file, the problem is this PHP file won't show anything in output.
I have tried to find the solution all over Internet but can't find any.
This is the source code:
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$email = $_POST['user_email'];
require_once 'DB_Connect.php';
$db = new DB_Connect();
$response = array();
$sql = ("SELECT * FROM white_list WHERE user_email = '" . $email . "'");
$result = mysqli_query($db->connect(), $sql) or die(mysqli_error());
$no_of_rows = mysqli_num_rows($result);
if ($no_of_rows > 0) {
$response["white_list"] = array();
while ($row = mysqli_fetch_array($result)) {
$white_list = array();
$white_list["name"] = $row["wl_name"];
$white_list["hp"] = $row["wl_hp"];
$white_list["address"] = $row["wl_address"];
$white_list["link"] = $row["wl_link"];
array_push($response["white_list"], $white_list);
}
$response["success"] = 1;
echo json_encode($response);
} else {
$response["success"] = 0;
$response["message"] = "No Data";
echo json_encode($response);
}
}