<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);  
include_once 'db_functions.php';

$db = new DB_Functions();     
$users = $db->getStateMaster();     
$a = array();     
$b = array();    
if ($users != false){         
while ($row = mysqli_fetch_array($users)) 
{                     


$b["stateid"] = $row["stateid"];
$b["state"] = $row["state"];

       
array_push($a,$b);         
}         
echo json_encode($a);     
} 
?>