I have a database which has the configuration as shown in the picture
I am trying to query
SELECT * FROM emails WHERE ('from_type=Manager' OR 'to_type=Manager') AND ('from=2' OR 'to=2')
Try this Code and let me know if you get your Desired Output.
SELECT * FROM emails
WHERE (`from_type`= 'Manager' OR `to_type`='Manager') AND (`from`='2' OR `to`='2')