Reputation: 652
I got this PHP code:
// connect to mysql
require_once('includes/connect.php');
// include config
include('includes/config.php');
$nameser = $_GET['term'];
$search = Array();
$names = '';
$result = mysql_query("SELECT name FROM customers WHERE name LIKE '%".$nameser."%'");
while ($row = mysql_fetch_assoc($result))
$names = json_encode($row['name']);
echo $names;
But the output is not formatted right, so the autocomplete script cannot figure out what it should do with it.
Also, this example only outputs 1 entry, but there should be far more than that.
Any ideas?
Upvotes: 2
Views: 1566