<?php 
include("db_config.php"); 
if($_SERVER['REQUEST_METHOD']=='POST'){
     $user_id = $_POST['user_id'];
	$sql="select user_profile.*,countries.name as count_name,states.name as st_name,cities.name as c_name from user_profile join countries on user_profile.country=countries.id join states on user_profile.state=states.id join cities on user_profile.city=cities.id where user_profile.id ='$user_id'";
    $result = mysqli_query($conn, $sql);
	if(mysqli_num_rows($result) > 0) {
		while($row[] = mysqli_fetch_assoc($result)) {
		 $tem = $row;
		 }
	  $response['data']=$tem;
	  $response['status']=1;
	}
	else {
		$response['status']=0;
	}
	echo json_encode($response);
	mysqli_close($conn);
}