krap 0 Report post Posted April 5, 2005 Ok here's a challenge for those who unlike me are good at php and mysql. I have a mysql database called users which has 2 (relevant) fields username and points which can be added or subtracted depending on how they good they are at rap battling(i run a hiphop forum). I also am going to make a table called crews. each crew will have 10 fields: creator, member1, member2, member3 etc. all the way to member10. Is there a script i could make(or you could make for me if you like reputation ) that could count up all the points for all the users in every crew and put them in a league. Eg. If "crew1"'s members all had 10 points and "crew2"'s had 20 each it would look like:1. Crew 2 (200 points)2. Crew 1 (100 points)That would be assuming they had 10 members each.So if you can help or point me in the right direction id be very thankful and forever in you debt..Thanks in advancekrap Share this post Link to post Share on other sites
mobious 0 Report post Posted April 5, 2005 use this query: SELECT creator, (crew1 + crew2 + crew3 + crew4 + crew5 + crew6 + crew7 + crew8 + crew9 + crew10) as score FROM crews Share this post Link to post Share on other sites
RGPHNX 0 Report post Posted April 5, 2005 Hi krap,Am interseted in creating a basic "rep" system for forum members on a friends site.QUESTION: Where did you get the php code for your basic rep system????Can you give me a url/link etc. for it??? OR possibly PM the code to me??Any help appreciatedThanks in advanceRGPHNX Share this post Link to post Share on other sites
krap 0 Report post Posted April 6, 2005 use this query: SELECT creator, (crew1 + crew2 + crew3 + crew4 + crew5 + crew6 + crew7 + crew8 + crew9 + crew10) as score FROM crews 68623[/snapback] I dont understand that code im not very good at mysql querys would i need to add anything to it to show the list i wanted to make? Share this post Link to post Share on other sites
mobious 0 Report post Posted April 6, 2005 just edit this code for your site: $sql = "SELECT creator, (crew1 + crew2 + crew3 + crew4 + crew5 + crew6 + crew7 + crew8 + crew9 + crew10) as score FROM crews";if (!($result = mysql_query($sql))) { exit(mysql_error() . ' - ' . $sql);}while ($crews[] = mysql_fetch_assoc($result));for ($x = 0; $x < count($crews) - 1; $x++) { print '1. ' . $crews[$x]['creator'] . ' ' . $crews[$x]['score'];} Share this post Link to post Share on other sites