Andrei4ik93, если быдлокодить то,
$arr = array();
$sql = mysql_query("select id, nick from user");
while($row = mysql_fetch_row($sql)) {
$count = mysql_result(mysql_query("select count(*) from post_forum where id_user = $row[0]"), 0);
$arr[$row[0]] = array($row[1] => $count);
}
echo '<pre>';
print_r($arr);