0
I need to make a query to search all records that have the term typed in a input, for example: Car, be returned blue car, green car, etc...
My query current:
$query = "SELECT * FROM veiculos WHERE nome = '$veiculo'";
Thank you
0
I need to make a query to search all records that have the term typed in a input, for example: Car, be returned blue car, green car, etc...
My query current:
$query = "SELECT * FROM veiculos WHERE nome = '$veiculo'";
Thank you
0
You can use the operator LIKE
. Your query would look this way:
"SELECT * FROM veiculos WHERE nome LIKE '%$veiculo'%";
See more details in the documentation.
Thank you, it worked perfectly.
Browser other questions tagged php mysql mysqli
You are not signed in. Login or sign up in order to post.
$query = "SELECT * FROM veiculos WHERE nome LIKE '%$veiculo%'";
– MarceloBoni
Thank you, it worked perfectly.
– abduzeedo