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. Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/ 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. Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043378 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. Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043379 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.. Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043381 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? Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043387 Share on other sites More sharing options...
TeddyKiller Posted April 16, 2010 Share Posted April 16, 2010 Ah yeah. Slight difference at the end Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043397 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' Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043406 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 Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043612 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. Link to comment https://forums.phpfreaks.com/topic/198801-easy-question/#findComment-1043660 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.