<?php

// Get the user id
$user_id = $_REQUEST['user_id'];

// Database connection
$con = mysqli_connect("localhost","infos9kd_info","infossel123.","infos9kd_sridurga");

if ($user_id !== "") {
	
	// Get corresponding first name and
	// last name for that user id	
	$query = mysqli_query($con, "SELECT name,sbname,fname,mname,hname,address,address1,address2,lmark,g1,g2,g3 FROM customerdetailsm WHERE pno ='$user_id'");

	$row = mysqli_fetch_array($query);

	// Get the first name

	$first_name = $row["name"];
	$first_name1 = $row["sbname"];
	$first_name2 = $row["fname"];
	$first_name3 = $row["mname"];
	$first_name4 = $row["hname"];
	$first_name5 = $row["address"];
	$first_name6 = $row["address1"];
	$first_name7 = $row["address2"];
	$first_name8 = $row["lmark"];
	$first_name9 = $row["g1"];
	$first_name10 = $row["g2"];
	$first_name11 = $row["g3"];
	
		
		

}

// Store it in a array
$result = array("$first_name","$first_name1","$first_name2","$first_name3","$first_name4","$first_name5","$first_name6","$first_name7","$first_name8","$first_name9","$first_name10","$first_name11");

// Send in JSON encoded form
$myJSON = json_encode($result);
echo $myJSON;
?>


