$num = 6;
$page = (int)$_GET['page'];
$count = mysql_query("SELECT COUNT (*) FROM table_products WHERE visible = '1'",$link);
$temp = mysql_fetch_array($count);
if ($temp[0] > 0)
{
$tempcount = $temp[0];
// Находим общее число страниц
$total = (($tempcount - 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;
$qury_start_num = " LIMIT $start, $num";
}
Обновление
Текст ошибки.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) FROM table_products WHERE visible = '1'' at line 1