Search Field Query

0

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

    
asked by anonymous 14.02.2017 / 13:15

1 answer

0

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 .

    
14.02.2017 / 13:24