tom2oo8 Posted October 30, 2008 Share Posted October 30, 2008 Ok im new to php but have made the rest of my game. factions in this are group of members who work together to get the most money. Im trying to get a ranking system to: find the users in a specific faction add up all there money, I know how to rank them once ive done that but i really dont know where to start and how i would go aabbout doing this so if any one could help thanks. And hi to everyone just signed up Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/ Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 Looking for a query you mean? SELECT SUM(money) AS money, faction FROM players GROUP BY faction ORDER BY money Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/#findComment-678862 Share on other sites More sharing options...
tom2oo8 Posted October 30, 2008 Author Share Posted October 30, 2008 Thanks but would that work if in the database it was like this: Tables: Users----has users money and faction name in it and faction --- has faction name and TOTAL money So is there any way of working out the total money?? it would have to: check if user is in a faction Check the users who are in the same faction add there money up??? Sorry for making you or anyone else basiclly write the code i wouldnt mind if you pointed me in the right direction Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/#findComment-678877 Share on other sites More sharing options...
tom2oo8 Posted October 30, 2008 Author Share Posted October 30, 2008 Wait dont worry lol i realised i dont actually need another table Thanks it help me sooo much Also my host dont actually tell me what msql version it is fixed it Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/#findComment-678881 Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 You can easily check mysql server version from PHP http://www.php.net/manual/en/function.mysql-get-server-info.php Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/#findComment-678885 Share on other sites More sharing options...
tom2oo8 Posted October 30, 2008 Author Share Posted October 30, 2008 You can easily check mysql server version from PHP http://www.php.net/manual/en/function.mysql-get-server-info.php ooo that helps... Thanks.. but 1 last thing how do i get it not to rank users that isnt in a faction? Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/#findComment-678886 Share on other sites More sharing options...
tom2oo8 Posted October 30, 2008 Author Share Posted October 30, 2008 fixed it ~ SELECT SUM(money) AS money, faction FROM users WHERE faction!='' GROUP BY faction ORDER BY money DESC Quote Link to comment https://forums.phpfreaks.com/topic/130801-solved-faction-game-help/#findComment-678895 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.