The Yandex bot's useragent looks something like this:
Mozilla/5.0 (compatible; YandexBot/3.0)
The identifying string stored in the exclusions 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.
Code: Select all
// user agent captured from browser
$useragent = "Mozilla/5.0 (compatible; YandexBot/3.0)";
// 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?]";
How should this query be completed?