flemingmike Posted October 18, 2010 Share Posted October 18, 2010 hello, the following is pulling all my records. is it written wrong? $result4 = mysql_query("SELECT * FROM schedule WHERE eid = '$posteid' AND status = 1 OR status = 2 ORDER BY date, starttime"); Quote Link to comment https://forums.phpfreaks.com/topic/216169-and-or-not-working/ Share on other sites More sharing options...
Mchl Posted October 18, 2010 Share Posted October 18, 2010 Yes it is. Is 5 * 2 + 3 same as 5 * (2 + 3) ? Quote Link to comment https://forums.phpfreaks.com/topic/216169-and-or-not-working/#findComment-1123452 Share on other sites More sharing options...
flemingmike Posted October 18, 2010 Author Share Posted October 18, 2010 so would it be $result4 = mysql_query("SELECT * FROM schedule WHERE status = 1 OR status = 2 AND eid = '$posteid' ORDER BY date, starttime"); Quote Link to comment https://forums.phpfreaks.com/topic/216169-and-or-not-working/#findComment-1123454 Share on other sites More sharing options...
Mchl Posted October 18, 2010 Share Posted October 18, 2010 I believe you want WHERE (status = 1 OR status = 2) AND eid = '$posteid' Quote Link to comment https://forums.phpfreaks.com/topic/216169-and-or-not-working/#findComment-1123456 Share on other sites More sharing options...
flemingmike Posted October 18, 2010 Author Share Posted October 18, 2010 thanks! Quote Link to comment https://forums.phpfreaks.com/topic/216169-and-or-not-working/#findComment-1123457 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.