require("../../config/connect.php");
//connect to your database
$term = trim(strip_tags($_GET['project']));//retrieve the search term that autocomplete sends
$qstring = "SELECT member.member_id, member.member_kr_name FROM member WHERE member.member_kr_name LIKE '%".mysql_real_escape_string($term)."%' ";
$result = mysql_query($qstring);//query the database for entries containing the term
$return_arr = array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))//loop through the retrieved values
{
$row_array['id'] = $row['member_id'];
$row_array['name_kr'] = $row['member_kr_name'];
array_push($return_arr,$row_array);
}
echo json_encode($return_arr);//format the array into json data