I'm currently implementing a search engine with JQuery UI autocomplete.
The records are stored in a mysql db.
It returns results, but not enough.
If I execute a search with LIKE %"abdo"%
in phpmyadmin, I get 6 results; In the present case, with Jquery and the db call script, I don't even get one.
Sometimes, it suggests the word, but only after 3 or 4 characters. It's surprising, because I put MinLength to 0 in the settings.
<script type="text/javascript">
$(function() {
//autocomplete
$(".auto").autocomplete({
source: "autocomplate.php",
delay: 0,
minLength: 0
});
});
</script>
And part of the autocomplate.php:
$stmt = $conn->prepare('SELECT word_fr FROM words_medina WHERE word_fr LIKE :term');
$stmt->execute(array('term' => '%' . $_GET['term'] . '%'));
while($row = $stmt->fetch()) {
$return_arr[] = $row['word_fr'];
}
Has anyboday any idea? I would appreciate your kind support. Thanks in advance!