01.
<?php
02.
require_once
(
"config.inc.php"
);
03.
04.
header(
"Content-type:text/html; charset=UTF-8"
);
05.
header(
"Cache-Control: no-store, no-cache, must-revalidate"
);
06.
header(
"Cache-Control: post-check=0, pre-check=0"
, false);
07.
header(
'Content-Type: application/json'
);
08.
09.
$key
=
$_GET
[
'q'
];
10.
$array
=
array
();
11.
$strSQL
="SELECT PHONE, NAME FROM members
12.
WHERE PHONE LIKE
'%".$key."%'
LIMIT 10";
13.
$result
= mysql_query(
$strSQL
);
14.
15.
while
(
$row
= mysql_fetch_assoc(
$result
)) {
16.
$array
[] =
array
(
"id"
=>
$row
[
"ME_PHONE"
],
"value"
=>
$row
[
"ME_NAME"
]);
17.
}
18.
echo
json_encode(
$array
, JSON_UNESCAPED_UNICODE);
19.
?>