Skip to content

Commit

Permalink
Merge pull request #88 from EyesOfNetworkCommunity/admin_bp
Browse files Browse the repository at this point in the history
🐛 Fix admin_bp auto_completion #85
  • Loading branch information
Julien1498 authored Mar 15, 2021
2 parents 80bfde6 + 8e97000 commit 64c4d09
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 64c4d09

Please sign in to comment.