i want to query the database for say "dog" but if i just type that in, it will only show results that are exactly "dog" not "dogs" "doggies" etc...
How do i do this?
Printable View
i want to query the database for say "dog" but if i just type that in, it will only show results that are exactly "dog" not "dogs" "doggies" etc...
How do i do this?
use the like operator with a wildcard. the like operator will allow case insensitive matches and the wild card will allow partial matches of your term. the wild card for mysql is "%."
the above will match DOG, dOg, dogs, DOGGIES, etc.Code:SELECT field1, field2 FROM tablename WHERE field3 LIKE '%dog%';