[SOLVED] PHP + SQL: Not getting the rows I want
Posted: Sun Jun 17, 2007 9:46 am
Hi!
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..
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..
Code: Select all
$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 ";