Thanks for the code, I'll keep it for future use.
I ran the code, and it didn't produce any errors. The result is below (I've edited it a bit to improve readability)
First Query:
SELECT * FROM jssm_subscriber_details WHERE
subscriber_email LIKE '%ea%' AND subscriber_confirmed = 'Y'
OR
subscriber_name LIKE '%ea%' AND subscriber_confirmed = 'Y'
OR
subscriber_email LIKE '%ea' AND subscriber_confirmed = 'Y'
OR
subscriber_name LIKE '%ea' AND subscriber_confirmed = 'Y'
OR
subscriber_email LIKE 'ea%' AND subscriber_confirmed = 'Y'
OR
subscriber_name LIKE 'ea%' AND subscriber_confirmed = 'Y'
ORDER BY subscriber_email,subscriber_name
Second Query:
SELECT * FROM jssm_subscriber_details WHERE
subscriber_email NOT LIKE '%andy%' AND subscriber_confirmed = 'Y'
OR
subscriber_name NOT LIKE '%andy%' AND subscriber_confirmed = 'Y'
OR
subscriber_email NOT LIKE '%andy' AND subscriber_confirmed = 'Y'
OR
subscriber_name NOT LIKE '%andy' AND subscriber_confirmed = 'Y'
OR
subscriber_email NOT LIKE 'andy%' AND subscriber_confirmed = 'Y'
OR
subscriber_name NOT LIKE 'andy%' AND subscriber_confirmed = 'Y'
ORDER BY subscriber_email,subscriber_name
The two queries are syntactically identical, but the first still works as expected, and the second still pulls out every record regardless of the search term.
I know that the first query works because I test it with just 6 records so that I can predict what it should pull out beforehand, and it is always 100% correct.
I'm just as baffled as ever, but thanks for your help anyway.