PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I need to get all the rows where a user id comes up in either s_user1, s_user2, s_user3 and the user has a video. But it shows up all the rows, either it has a video or not.
If I leave only the s_vids= 'Yes' it works. but with the s_user OR ... it doesn't..
$SQL = " SELECT * FROM shoots WHERE s_user1= '$m_id' OR s_user2 ='$m_id' OR s_user3 ='$m_id' AND s_vids = 'Yes' AND s_date <= $today ORDER BY s_id DESC ";
Last edited by thiscatis on Sun Jun 17, 2007 9:59 am, edited 1 time in total.
superdezign is referring to adding parentheses around the ORs as they have the same precedence as the ANDs making the evaluation not follow what you want.