Good morning,
I just autocomplete an input via mySQL
the problem is that if I have in a table clients, the names
camilo Camilo Carlos
by pressing "c" in the input the three results appear, that is to say, the two camilos usually take me
as I could do so that only the options appear
camilo Carlos
ie ignore that there are two "camilo" and show me only 1, I put LIMIT 1 but I learned that it shows only one in this case camilo since it is sorted in ascending order
I imagine that I must parameterize it in the mysql query, I currently have it that way, where the variable
$_POST["query"]
is the search term entered in the input
SELECT * FROM cuentas WHERE nombre_cliente LIKE '%".$_POST["query"]."%' ORDER BY nombre_cliente ASC