File: /var/www/nclive/technc/kvs_navodya_list_ajax.php
<?php
header('Content-Type: application/json');
include "config.php";
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$id=$_REQUEST['id'];
$query="SELECT t1.id, t1.type, t1.name, t1.url_slug, t1.state_id, t1.city_id,t1.pincode,t1.address, t1.longitude, t1.latitude,t1.important_emails, t1.important_phones, t1.official_website_link, t1.online_apply_link, t1.online_fee_link, t1.result_link, t1.other_info,t1.display_order, t1.status,t2.state_name ,t1.added_date,t3.city as city FROM sp_kvs_navodya as t1
LEFT JOIN sp_states as t2 on t2.state_id=t1.state_id
LEFT JOIN sp_city as t3 on t3.city_id=t1.city_id where id='$id'";
$sql=$db->prepare($query);
$sql->execute();
$row=$sql->fetch();
echo json_encode($row,TRUE);
?>