I'm currently working on a search bar which return every Car Brand and Car Model combined according to what the user write into a textbox (Autocomplete function of jQuery)
I tried different things but, doesn't find what I need.
Here's my request (Not working) :
SELECT carBrand_lib, carModel_lib FROM Model AS mo
INNER JOIN Brand AS br ON br.carBrand_ID = mo.carBrand_ID
GROUP BY carBrand_lib, carModel_lib
HAVING (carBrand_lib + carModel_lib)
LIKE '%".$searchTerm."%'
ORDER BY carModel_lib ASC LIMIT 10
I did another request which working, but only with the Car Brand or the Model separated but don't find for the two combined.
SELECT carBrand_lib, carModel_lib FROM Model AS mo
INNER JOIN Brand AS br ON br.carBrand_ID = mo.carBrand_ID
WHERE carModel_lib LIKE '%".$searchTerm."%' OR carBrand_lib
LIKE '%".$searchTerm."%'
ORDER BY carModel_lib ASC LIMIT 10
An example of what I need :
If the user search "Porsche 9" for example, it will return from the database : "Porsche 911" or something else containing "Porsche 9", in a list.
With "GT" as research, the database will return "Ford GT", "Nissan GTR"...
How can I make my SQL request to research in two columns combined at the same time ?