This script ignores all Admin / GMs characters as you can see (accessLevel = 0) in query.
First define your MySQL connection:
Code: Select all
$db_link = mysql_connect('host', 'user', 'password');
Code: Select all
$db_selected = mysql_select_db("database",$db_link);
Code: Select all
<?php$db_link = mysql_connect('host', 'user', 'password'); mysql_query("SET CHARACTER SET utf8");if (!$db_link) { echo('Could not connect: ' . mysql_error());}$db_selected = mysql_select_db("database",$db_link);$FORM = "<table> <tr> <th align=center>Pos.</th> <th width='175px' class='Stil5' align=center>Character</th> <th width='150px' class='Stil5' align=center>Wealth</th> </tr>"; $query_chars = "SELECT * FROM items INNER JOIN characters ON items.owner_id=characters.charId WHERE item_id=57 AND characters.accesslevel = 0 AND items.loc='INVENTORY' order by count desc limit 10"; $link = mysql_query($query_chars); $i=1; $r=255; while ( $row=mysql_fetch_array($link) ) { $FORM .= "<tr> <td align=center>$i</span></td> <td align=center>$row[char_name]</td> <td align=center>".number_format($row['count'])."</td> </tr>"; $i++; $r -= 0; } echo $FORM;echo '</table>';?>
Enjoy!