Hm, i am take the query from ASP files:
[php:1:bb801b48bb]$result=mssql_query("SELECT TmpD.sumamount,user_data.char_name,user_data.gende r,user_data.account_name,user_data.lev,user_data.b uilder FROM (SELECT char_id, SUM(amount) AS sumamount FROM user_item WHERE item_type = $id GROUP BY char_id) TmpD INNER JOIN user_data ON TmpD.char_id = user_data.char_id WHERE account_id>0 ORDER BY TmpD.sumamount DESC");
[/php:1:bb801b48bb]
Where $id - Item type. Work fine, i see all who has that item (or items).
In your code some mistakes:
[php:1:bb801b48bb]for($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++){
$online_users[$x]['use_time_h']=round($online_users[$x]['use_time']/3600,1)."h";
};
[/php:1:bb801b48bb]
$online_users[$x]['use_time_h']=round($online_users[$x]['use_time']/3600,1)."h"; - it is not necessary
And you don't write this in query - "account_id>0", all deleted chars will are shown, if they have item.
Thx for share.