Assuming that P99's character table isn't much different from the default PEQ character table, the SQL would just be something like:
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level > '5' GROUP BY class;
Replace 5 with whatever level you want to check for. That will check for individual characters (not accounts) that have been logged on in the past 7 days, so it would eliminate some mules and unplayed alts from the list. You could even use this to show representation within brackets (ie. "level > '5 AND level < '11'" would give you the 5-10 bracket, etc).
Edit:
Assuming that it wouldn't put too much strain on the SQL server, you could create a PHP script that would display the different brackets. You'd just need to decide what brackets you wanted it chopped by, but it could pull and display say 1-9, 10-19, 20-29, 30-39, 40-49, and 50.
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level > '0' AND level < '10' GROUP BY class;
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level > '9' AND level < '20' GROUP BY class;
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level > '19' AND level < '30' GROUP BY class;
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level > '29' AND level < '40' GROUP BY class;
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level > '39' AND level < '50' GROUP BY class;
SELECT class, count(distinct id) FROM character_ WHERE timelaston > (UNIX_TIMESTAMP() - 604800) AND level = '50' GROUP BY class;
|