MasterACE14 Posted April 12, 2009 Share Posted April 12, 2009 I have this query that doesn't give any errors, and it is half working. here is the query... SELECT `AllRanks`.`Rank` , `UserDetails`.`userName` , `Alliance`.`Alliance_Name` FROM `UserDetails` , `AllRanks` , `Alliance` WHERE `UserDetails`.`ID`='91' AND `AllRanks`.`id`='91' AND `UserDetails`.`Alliance` = `Alliance`.`Alliance_ID` LIMIT 1 Basically the problem(I think) is with the last part of the 'WHERE' `UserDetails`.`Alliance` = `Alliance`.`Alliance_ID` `UserDetails`.`Alliance` is the ID of the alliance the player is in. Column is Varchar. default is blank ''. `Alliance`.`Alliance_ID`is the ID of the alliance. Column is Integer. Auto_Increment. Basically if someone isn't in an Alliance, then `UserDetails`.`Alliance` will just be blank, and then the query returns nothing because there is no 'blank' alliance. So how do I go about fixing the query to SELECT everything I need, whether or not the `UserDetails`.`Alliance` matches a `Alliance`.`Alliance_ID` or not? Regards, ACE Quote Link to comment https://forums.phpfreaks.com/topic/153713-solved-long-query-random-output/ Share on other sites More sharing options...
MasterACE14 Posted April 13, 2009 Author Share Posted April 13, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/153713-solved-long-query-random-output/#findComment-808407 Share on other sites More sharing options...
fenway Posted April 14, 2009 Share Posted April 14, 2009 Really? Don't bump then marked "solved" without at least posting the solution.... Quote Link to comment https://forums.phpfreaks.com/topic/153713-solved-long-query-random-output/#findComment-810114 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.