topflight Posted March 14, 2009 Share Posted March 14, 2009 Is it possible to use an or statement in a mysql query. Because I am trying to do a query to see if the member has board member accesses or HRO accesses or HM accesses or ed. If I do a and then I will get nothing back becuase a member will only have 1 of those not all. So is their a way to do an or statement in mysql query? Link to comment https://forums.phpfreaks.com/topic/149354-solved-or-statment-in-mysql-query/ Share on other sites More sharing options...
.josh Posted March 14, 2009 Share Posted March 14, 2009 post your query. Link to comment https://forums.phpfreaks.com/topic/149354-solved-or-statment-in-mysql-query/#findComment-784417 Share on other sites More sharing options...
topflight Posted March 14, 2009 Author Share Posted March 14, 2009 $mlist = mysql_query(" SELECT * FROM `members` WHERE `status` =1 AND `active` =1 AND `hm` =1 AND `ed` =1 AND `hr` =1 AND `bm` =1"); Link to comment https://forums.phpfreaks.com/topic/149354-solved-or-statment-in-mysql-query/#findComment-784418 Share on other sites More sharing options...
Festy Posted March 14, 2009 Share Posted March 14, 2009 $mlist = mysql_query(" SELECT * FROM `members` WHERE `status` =1 AND `active` =1 AND `hm` =1 AND `ed` =1 AND `hr` =1 AND `bm` =1"); Here it is: $mlist = mysql_query(" SELECT * FROM `members` WHERE `status` =1 AND `active` =1 AND (`hm` =1 OR `ed` =1) AND `hr` =1 AND `bm` =1"); Link to comment https://forums.phpfreaks.com/topic/149354-solved-or-statment-in-mysql-query/#findComment-784424 Share on other sites More sharing options...
topflight Posted March 14, 2009 Author Share Posted March 14, 2009 thanks Link to comment https://forums.phpfreaks.com/topic/149354-solved-or-statment-in-mysql-query/#findComment-784541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.