I have a form that is giving me information like INPUT1, INPUT2.  I need to select from COL1 and COL2 where COL1 = INPUT1, COL2 = INPUT2 or the other way around, COL1 = INPUT2, COL2 = INPUT1. 
SELECT * FROM table WHERE 
                      (COL1 = INPUT1 AND COL2 = INPUT2) 
                   OR (COL1 = INPUT2 AND COL2 = INPUT1);
SELECT * FROM table WHERE ( COL1=INPUT1 AND COL2=INPUT2 ) OR ( COL1=INPUT2 AND COL2=INPUT1 )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With