In our original HTML form, we had a hidden field that sets this variable to "yes" when submitted. This line checks for that. If the form has been submitted then it runs the PHP code, if not it just ignores the rest of the coding.
if ($searching =="yes")
The next thing we check before we run the query is that they actually entered a search string. If they haven't, we prompt them to, and don't process any more of the code. If we didn't have this code, and they entered a blank result, it would simply return the entire database's contents.
if ($find == "")
After this check we connect to our database, but before we can search we need to filter.
This changes all of the characters of the search string to UPPER case. We will explain how this is useful later.
$find = strtoupper($find)
This takes out any code they may have tried to enter in to the search box.
$find = strip_tags($find)
And this takes out all the whitespace - for example if they accidently put a few spaces at the end of their query.
$find = trim ($find)