Owner Total credit Recent average credit CPU type EOT; } function show_host_row($host) { $result = mysql_query("select * from user where id = $host->userid"); $user = mysql_fetch_object($result); mysql_free_result($result); echo " id>$user->name $host->total_credit $host->expavg_credit $host->p_vendor $host->p_model "; } $max_hosts_display = 100; db_init(); page_head("Top hosts"); $result = mysql_query("select * from host order by expavg_credit desc limit $max_hosts_display"); host_table_start(); while (($host = mysql_fetch_object($result)) && $max_hosts_display > 0) { show_host_row($host); $max_hosts_display--; } mysql_free_result($result); echo "\n"; page_tail(); ?>