Commit 8e97000b authored by Julien1498's avatar Julien1498
Browse files

🐛 Fix admin_bp auto_completion #85

parent 745d04a5
......@@ -8,14 +8,12 @@ $q = $_GET['query'];
$table_name = $_GET['table_name'];
// Requête SQL
$datas = array(
$table_name,
$q
);
$requete = sql($database_lilac, "SELECT name FROM ? WHERE name LIKE '?%' LIMIT 0, 10", $datas);
$datas = array($q."%");
$requete = sql($database_lilac, "SELECT name FROM " . $table_name . " WHERE name LIKE ? LIMIT 0, 10", $datas);
$requete = $requete[0];
foreach($requete as $row) {
$suggestions['suggestions'][] = $row['name'];
for($i = 0; $i<count($requete)/2; $i++){
$suggestions['suggestions'][] = $requete[$i];
}
echo json_encode($suggestions);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment