Hi there, i want to search a table, for posts by person1 OR person2? Can any1 tell me how?
I have tried;
SELECT * FROM users WHERE username = '$str1' OR username = '$str2'
Anyone have any ideas?
That should work. What error are you getting?
Try using parentheses:
SELECT * FROM users WHERE ((username = '$str1') OR (username = '$str2'))
A better construct for simple equality is the "IN" keyword anyway:
SELECT * FROM users WHERE username IN ('$str1', '$str2')