mikeymike Posted March 23, 2007 Posted March 23, 2007 im a complete noob at this and im just trying to learn something. can someone see if they can tell me what i am doing wrong here? i may be way off on the code for what i am attempting } function hof_attacks() { global $ir,$c,$userid; print "Showing the 20 users with the highest total attacks Pos User $q=mysql_query("SELECT u.*,g.* FROM attacklogs u LEFT JOIN gangs g ON g.gangID=u.gang WHERE u.user_level != 0 ORDER BY (us.wins+losses) DESC,u. userid ASC LIMIT 20", $c); $p=0; while($r=mysql_fetch_array($q)) { $p++; if($r['userid'] == $ir['userid']) { $t="";$et=""; } else { $t="";$et=""; } print "$t$p$et $t{$r['gangPREF']} {$r['username']} [{$r['userid']}]$et "; } i am trying to put a category in my HOF for most total attacks. i also want it to list the total there too. i know i didnt include that part anywhere yet. please dont make fun of me if i am going completely in the wrong direction with this. i cant figure out why it wont show anything when i click the link for "total attacks". i dont get any kind of error Quote
Vorlen Posted March 23, 2007 Posted March 23, 2007 Re: please help with HOF I would suggest doing this. Add a category to your usertable called "attacks" change attack system so when you attack it adds one to your attacks count, win or loss. Then, you simply call that number and order by the highest to lowest, limit 20. :) Make any sense? Quote
mikeymike Posted March 23, 2007 Author Posted March 23, 2007 Re: please help with HOF the attack total, wins and losses are already stored in the database. i forgot to mention that i appreciate the help so far. please bear with me. i am extremely new at this Quote
Decepti0n Posted March 23, 2007 Posted March 23, 2007 Re: please help with HOF you could just order it by total attacks then :p Quote
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.