Im trying to get the Id from the user and result must display the Details from the particular row of ID.. im using PHP coected to android studio there is no errors in android studio but when i try to view the web address of the PHP code i get thsis NULL values. I want to display the data from my database
{"result":[{"name":null,"useame":null,"email":null,"age":null,"password":null}]}
here is my code of PHP:
if($_SERVER['REQUEST_METHOD']=='GET'){
$id = $_GET['id'];
$sql = "SELECT * FROM user WHERE id='".$id."'";
$r = mysqli_query($con,$sql);
$res = mysqli_fetch_array($r);
$result = array();
array_push($result,array(
"name"=>$res['name'],
"useame"=>$res['useame'],
"email"=>$res['email'],
"age"=>$res['age'],
"password"=>$res['password']
)
);
echo json_encode(array("result"=>$result));
mysqli_close($con);
}
