To begin with, put SearchWordsSQL.php on the PHP library path. If the database server supports an SQL LIKE operator for text search, your code would be like: ...