Check if URL contains different strings
Why did you create multiple tables for each category?

Surely it would be better to have 1 single table with something like:


id - int
category - enum(lawyer, insurance, etc.)
url - varchar


You might want to have a look at this answer from StackOverflow for a better strpos alternative to your requirements: https://stackoverflow.com/a/9220624/367708