For example, consider:
title 1: The Indiana Highway project
title 2: The Michigan Highway project
Now when the user enters Highway in the form box both the titles need to be displayed.
If the user enters Michigan, only one title (title 2) needs to be displayed.
Is there a way to do this in MySQL or PHP?
If you’re always searching only for one word, you can use the
LIKEkeyword.The
%s are wildcards saying that any characters (or none) can be to the left and to the right of Highway.See documentation here.
If you plan on doing something more sofisticated, take a look at full text search.