<?php
include("../../db.php");
header('Content-Type: application/json');

$user_id = $_REQUEST['user_id'];
$status = 0;

$result = $db->getRows("SELECT * FROM school_data WHERE sales_person = '$user_id' ORDER BY id DESC");

if ($result){
    $status = 1;
}

echo json_encode(array("status" => $status, "data" => $result));