Witam znalazłem na stronie kod stronnicowania i go trochę przerobiłem i mam jeden problem a mianowicie chciałbym żeby jak dojdzie po klikaniu na następny na ostatnią stronę z wynikami to żeby zniknął przycisk następna.
Oto kod :
<?php
require 'header.php';
include("connect.php");
$bazadanych;
or
die("Nie ma takiej bazy danych");
$perPage = 3;
$page = (int) $_REQUEST['page'];
if ($page < 1) {
$page = 1;
}
} else {
$page = 1;
}
$start = ($page - 1) * $perPage;
//SELECT * FROM art LIMIT 0 , 4 - gdy jestes na stronie glownej
$query = "SELECT * FROM filmiki ORDER BY `filmiki`.`id` DESC LIMIT ".$start." , ".$perPage;
{
echo '<div class="art-post-inner art-article"> <div class="art-postmetadataheader">
<h2 class="art-postheader">
<center>'.$rekord["nazwa"].'</center>
</h2>
</div>
<div class="art-postcontent">
<p><center><iframe width="560" height="345" src="http://www.youtube.com/embed/'.$rekord["link"].'" frameborder="0" allowfullscreen></iframe></center></p>
</div>
<div class="cleared"></div>
</div>';
}
$prev = $page - 1;
$next = $page + 1;
$prevLink = $_SERVER['PHP_SELF'] . '?page=' . $prev;
$nextLink = $_SERVER['PHP_SELF'] . '?page=' . $next;
$page = (int) $_REQUEST['page'];
if ($page != 1) {
echo "<center><a href=".$prevLink.">Poprzednia</a></center>";
}
}
echo "<center><a href=".$nextLink.">Nastepna</a></center>"; or
die("Nie mogę rozłączyć się z bazą danych");require 'footer.php';
?>