Skip to content

Commit

Permalink
🐛 Fix admin_bp auto_completion #85
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien1498 committed Feb 25, 2021
1 parent 745d04a commit 8e97000
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions module/admin_bp/php/auto_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
$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);

Expand Down

0 comments on commit 8e97000

Please sign in to comment.