flemingmike Posted October 12, 2010 Share Posted October 12, 2010 hello, here is what i have. i feel like im close. $result4 = mysql_query("SELECT * FROM schedule WHERE eid = '$posteid' AND status = 1 OR 2"); Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/ Share on other sites More sharing options...
jcbones Posted October 12, 2010 Share Posted October 12, 2010 $result4 = mysql_query("SELECT * FROM schedule WHERE eid = '$posteid' AND status = 1 OR status = 2"); Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121577 Share on other sites More sharing options...
flemingmike Posted October 12, 2010 Author Share Posted October 12, 2010 thx man Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121579 Share on other sites More sharing options...
jcbones Posted October 12, 2010 Share Posted October 12, 2010 NP Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121580 Share on other sites More sharing options...
DavidAM Posted October 13, 2010 Share Posted October 13, 2010 Shouldn't that be: $result4 = mysql_query("SELECT * FROM schedule WHERE eid = '$posteid' AND (status = 1 OR status = 2)"); Otherwise you get all rows where eid == $posteid AND status == 1 along with the rows where status == 2 (regardless of the value of eid) Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121676 Share on other sites More sharing options...
joshd963 Posted October 13, 2010 Share Posted October 13, 2010 also should the 1 and 2 be in '' ie '1' or '2' correct me if im wrong Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121740 Share on other sites More sharing options...
DavidAM Posted October 14, 2010 Share Posted October 14, 2010 If the status column is numeric, the quotes are not required. Apparently mySql allows it though, and some people say it is safer. I'm old school, so I don't put numeric values in quotes. Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121997 Share on other sites More sharing options...
jcbones Posted October 14, 2010 Share Posted October 14, 2010 You are correct David, it should be in parenthesis. Quotes on INT column is moot, you can use them or not. It may be a little safer using them, if you security isn't top notch. Who can really say. Quote Link to comment https://forums.phpfreaks.com/topic/215730-propper-way-to-white-or/#findComment-1121999 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.