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"); 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) ? 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"); 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' 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! Link to comment https://forums.phpfreaks.com/topic/216169-and-or-not-working/#findComment-1123457 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.