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

$status = 0;
$msg = "Unable to fetch data..! Please retry later";
$data = array();

$result = $db->getRows("SELECT id,name FROM bus_detail");

if ($result){
    $status = 1;

    $data = $result;

    $msg = "Record found";
}else{
    $msg = "Record not found";
}

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