$chatcount = mysql_query("SELECT COUNT(*) FROM `chat`");
$total = mysql_result($chatcount, 0);
Перменную $total выводи куда надо.
$chatcount = mysql_query("SELECT COUNT(*) FROM `chat`");
$total = mysql_result($chatcount, 0);
Перменную $total выводи куда надо.