I need to make a query that searches all records that have the term typed in an input , for example: Car, return car blue, green car, etc. ..
My current query :
$query = "SELECT * FROM veiculos WHERE nome = '$veiculo'";
Thank you
I need to make a query that searches all records that have the term typed in an input , for example: Car, return car blue, green car, etc. ..
My current query :
$query = "SELECT * FROM veiculos WHERE nome = '$veiculo'";
Thank you
You can use the LIKE
operator. Your query would look like this:
"SELECT * FROM veiculos WHERE nome LIKE '%$veiculo'%";
See more details in the documentation .