<?php
	include('db.php');
// Check connection
if ($con->connect_error) {
    die("Connection failed: " . $con->connect_error);
}
$username= $_GET["user"];;
$sql = "SELECT category FROM tbl_users WHERE first_name='$username'";
$result = $con->query($sql);

if ($result->num_rows > 0) {
    $items = array();
    // output data of each row
    while($row = $result->fetch_assoc()) 
	{
		$item[] = array("category" => $row['category']);
    }
	$message=$item;
	$response=array('status' => "true", 'Message' => "Login success",'Login_details' => $message);  
            echo json_encode($response);
	
	} 
	else 
	{
     $response=array('status' => "false", 'Message' => "No Data");
            echo json_encode($response);
	}
$con->close();
?> 
