Народ возникла такая проблема "панигантор" не переключает страницы и не разбивает содержимое на страницы вот код
include("connect.php");
$table="nomera";
$nums = 20;
if (isset($_GET['page'])) {
$page = intval($_GET['page']);
}
else {
$page = 1;
}
$query = "SELECT COUNT(*) AS `counter`
FROM `$table`";
$sql = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_assoc($sql);
$elements = $row['counter'];
$pages = ceil($elements/$nums);
if ($page < 1) {
$page = 1;
}
elseif ($page > $pages) {
$page = $pages;
}
$start = ($page-1)*$nums;
if ($start < 0) $start = 0;
$query = "SELECT *
FROM `$table`
LIMIT {$start}, {$nums}";
$sql = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_assoc($sql)) {
}
echo "<style type='text/css'>
page{
padding-left: 5px;
padding-right: 5px;
border:1px solid:#EAEEF8;
background-color: #3366FF;
font-family: arial;
color:white;
font-size: 13px
}
a.page:link,
a.page:hover,
a.page:visited{
font-family: arial;
text-decoration: none;
font-size: 13px;
padding-left: 4px;
padding-right: 4px;
border:1px solid:#EAEEF8;
color: #3366FF;
}
</style>";
$neighbours = 6;
$left_neighbour = $page - $neighbours;
if ($left_neighbour < 1) $left_neighbour = 1;
$right_neighbour = $page + $neighbours;
if ($right_neighbour > $pages) $right_neighbour = $pages;
if ($page > 1) {
print ' <a href="?page=1">начало</a> ... <a href="?page=' . ($page-1) . '">назад</a> ';
}
for ($i=$left_neighbour; $i<=$right_neighbour; $i++) {
if ($i != $page) {
print ' <a href="?page=' . $i . '">' . $i . '</a> ';
}
else {
print ' <b>' . $i . '</b> ';
}
}
if ($page < $pages) {
print ' <a href="?page=' . ($page+1) . '">вперед</a> ... <a href="?page=' . $pages . '">конец</a> ';
}
ЗАРАНЕЕ СПАСИБО