karimali831 Posted April 13, 2010 Share Posted April 13, 2010 Take a look at attatchment. I want to select all only from cupID 19 and (clan1 = 340 or clan2 = 340) not cupID = 19 OR clan2 = 340 only clan1 = 340 or clan2 = 340 anyway? thanks for help. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 13, 2010 Share Posted April 13, 2010 You wrote the answer in your question - cupID 19 and (clan1 = 340 or clan2 = 340) WHERE cupID = 19 and (clan1 = 340 or clan2 = 340) Quote Link to comment Share on other sites More sharing options...
ChemicalBliss Posted April 13, 2010 Share Posted April 13, 2010 Use parenthesis to seperate arguments. Im sure it works: SELECT * FROM `...` WHERE (`cupID`='19') AND (`clan2`='340' OR `clan1`='340'); -CB- Quote Link to comment Share on other sites More sharing options...
karimali831 Posted April 13, 2010 Author Share Posted April 13, 2010 Lol ok thanks very much. Works Quote Link to comment Share on other sites More sharing options...
karimali831 Posted April 14, 2010 Author Share Posted April 14, 2010 what about if I wanted to use this: if(memin($userID,($teamid ||$oppid))) $variable = ''; else $variable = ''; I know that's wrong.. I want $userID and ($teamid or $oppid) I thought if(memin($userID,$teamid,$oppid)) may of worked but didn't. If I just used $teamid or $oppid it won't get all so I need to use both. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted April 14, 2010 Author Share Posted April 14, 2010 This does work if(memin($userID,$teamid)) $variable = ''; elseif(memin($userID,$oppid)) $variable = ''; else $variable = ''; Quote Link to comment 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.