Также нужно менять ссылки <a href=chat.php?page='. ($page - 1) .'>
на ваши стр..
$num = 10; // сколько выводить на стр...
$page = $_GET['page'];
$result00 = mysql_query("SELECT COUNT(*) FROM users"); //users //название вашей таблицы
$temp = mysql_fetch_array($result00);
$posts = $temp[0];
$total = (($posts - 1) / $num) + 1;
$total = intval($total);
$page = intval($page);
if(empty($page) or $page < 0) $page = 1;
if($page > $total) $page = $total;
$start = $page * $num - $num;
while ($test = mysql_fetch_assoc($test)) {
echo 'ваш код';
}
if ($page != $total) $nextpage = ' | След. | Посл.';
if($page - 5 > 0) $page5left = ' <a href=chat.php?page='. ($page - 5) .'>'. ($page - 5) .' | ';
if($page - 4 > 0) $page4left = ' <a href=chat.php?page='. ($page - 4) .'>'. ($page - 4) .' | ';
if($page - 3 > 0) $page3left = ' <a href=chat.php?page='. ($page - 3) .'>'. ($page - 3) .' | ';
if($page - 2 > 0) $page2left = ' <a href=chat.php?page='. ($page - 2) .'>'. ($page - 2) .' | ';
if($page - 1 > 0) $page1left = '<a href=chat.php?page='. ($page - 1) .'>'. ($page - 1) .' | ';
if($page + 5 <= $total) $page5right = ' | <a href=chat.php?page='. ($page + 5) .'>'. ($page + 5) .'';
if($page + 4 <= $total) $page4right = ' | <a href=chat.php?page='. ($page + 4) .'>'. ($page + 4) .'';
if($page + 3 <= $total) $page3right = ' | <a href=chat.php?page='. ($page + 3) .'>'. ($page + 3) .'';
if($page + 2 <= $total) $page2right = ' | <a href=chat.php?page='. ($page + 2) .'>'. ($page + 2) .'';
if($page + 1 <= $total) $page1right = ' | <a href=chat.php?page='. ($page + 1) .'>'. ($page + 1) .'';
if ($total > 1)
{
Error_Reporting(E_ALL & ~E_NOTICE);
echo "<center><div class='menu'>
";
echo $pervpage.$page5left.$page4left.$page3left.$page2left.$page1left.''.$page.
''.$page1right.$page2right.$page3right.$page4right.$page5right.$nextpage;
echo "
";
}
echo '</div>';