This class can be used to search for words and phrases in text fields of a MySQL database table.
It can generate a Web search form with an input field to enter the search text, a submit button and radio buttons to let the user tell whether the search should find records with all the words or at least one of them. The form text and presentation style is configurable with CSS.
The class can perform the search for the specified text with prior cleanup to avoid security exploits. The searched text is stored in a session variable so the user can be reminded of the last search.
The search can treat words separately or as phrases when the user encloses the words in double quotes.
The search results are returned in an array that contains a list of distinct records that matched the searched text.
The table name and the table fields to be searched and the fields to be returned as result of the search are configurable. |