<?php
require_once "config.php";
if (isset($_GET['term'])) {
     
   $query = "SELECT * FROM  utm_mst_state  WHERE state_name LIKE '{$_GET['term']}%' LIMIT 25";
    $result = $conn->query($query);
 
    if ($result->num_rows > 0){   
        while($user=$result->fetch_assoc()){     
    
      $res[] = $user['state_name'];
     }
    } else {
      $res = array();
    }
    //return json res
    echo json_encode($res);
}
?>