PREG VS. QUERY
As I read your replies, I realized how most of the check can be done using a single query. There's only one part about which I'm unsure. Here's an example.
The Yandex bot's useragent looks something like this:
Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)
The identifying string stored in the table is:
YandexBot
I need to fashion the query that checks the full useragent to see if it contains the phrase stored in the database.
// user agent captured from browser
$useragent = "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)";
// query to check to see if $useragent has the string 'YandexBot' in it
$query = "SELECT exc_ua FROM exclusions WHERE exc_ua [what goes next?]";
I'm not sure what needs to go in place of [what goes next?] above since what is stored in the table is just a portion of $useragent.
How should this query be completed?