I am assuming you already know how to connect to a database and retrieve the results.
You can use something like this in your query:
SELECT * FROM my_table WHERE field LIKE %search_term%;
What the LIKE %search_term% will do is return all rows where your field matches the search phrase 'search_term', or anything before and after 'search_term'. That's what the % operator tells mysql to do.
If you want to search for something that starts with the search phrase, then you would do search_term%, something that ends with the search phrase, then %search_term
Hope that helps!