karimali831 Posted April 16, 2010 Share Posted April 16, 2010 Hi, With this query: SELECT * FROM ".PREFIX."cup_matches WHERE clan1='$getteam' || clan2='$getteam' && (clan1 != '0' && clan2 != '0') && (clan1 != '2147483647' && clan2 != '2147483647') or SELECT * FROM ".PREFIX."cup_matches WHERE clan1='$getteam' || clan2='$getteam' && (clan1 != '0' && clan2 != '0') && (clan1 != '2147483647' || clan2 != '2147483647') is still picks up records where clan2 = 2147483647 and I don't want it to. So do not select if clan1 = 2147483647 OR clan2 = 2147483647. Thanks for help also. Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted April 16, 2010 Share Posted April 16, 2010 || is a PHP Operator for OR. In MYSQL, it is OR. Quote Link to comment Share on other sites More sharing options...
oni-kun Posted April 16, 2010 Share Posted April 16, 2010 2147483647 is the maximum allocatable signed integer, Why are you running into the problem of having the clan ID set as so? There seems to be deeper flaws in the root of your coding logic. Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted April 16, 2010 Share Posted April 16, 2010 Both queries look the same, and both clan ID's look the same too.. Quote Link to comment Share on other sites More sharing options...
karimali831 Posted April 16, 2010 Author Share Posted April 16, 2010 @ TeddyKiller: thanks got it and if you look closely, it's not. @ oni-kun: if clanID is 2147483647 this means team on a tournament has been taken off so therefore I don't want it selected when I'm using this query to get all matches by clanID. It works.. so why does it matter? Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted April 16, 2010 Share Posted April 16, 2010 Ah yeah. Slight difference at the end Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted April 16, 2010 Share Posted April 16, 2010 Should work - SELECT * FROM ".PREFIX."cup_matches WHERE (clan1='$getteam' OR clan2='$getteam') AND clan1 != '0' AND clan2 != '0' AND clan1 != '2147483647' AND clan2 != '2147483647' Quote Link to comment Share on other sites More sharing options...
ignace Posted April 17, 2010 Share Posted April 17, 2010 || is a PHP Operator for OR. In MYSQL, it is OR. Are you sure? http://dev.mysql.com/doc/refman/5.5/en/non-typed-operators.html Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted April 17, 2010 Share Posted April 17, 2010 Oh.. my mistake. Just never had seen it used before. 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.