In MySQL I\'m trying to select any row that matches at least 2 fields of the provided data
Eg. I have been given firstName, lastName, dob, website, email and I want
As a'r's answer recommended, you can add together values. If you want to use this for ranking, you might not include it in the where clause as he did.
SELECT *, ((firstName = @inputFirst) + (lastName = @inputLast) + (dob = @inputDob) + (website = @inputWebsite) + (email = @inputEmail)) as Matches
FROM mytable
HAVING Matches > 1
ORDER BY Matches DESC
I don't have access to a mysql db to test this syntax at the moment, but I believe it should work properly.