require('includes/connect.inc.php'); ?>
![]() |
![]() |
||||||||||
![]() ![]() ![]() ![]() ![]() |
Een complimentje voor iemand op de Nationale Complimentensite?
Helaas! Door VGA niet meer mogelijk!
// op welke pagina zitten we if(!empty($_GET['extra'])){ $page = $_GET['extra']; }else{ $page=1; } $max = 10; // aantal items op een pagina $current = (($page * $max) - $max); // geef de limit voor de query // complimenten uit de database halen $query = "SELECT * FROM complimenten WHERE `verwijderd` = 'nee' AND `goedgekeurd` = 'ja' ORDER BY `compliment_id` DESC LIMIT $current, $max"; $result = mysql_query($query) or die(mysql_error()); //tellen hoeveel paginas we moeten maken $counttotal = mysql_query("SELECT * FROM complimenten WHERE `verwijderd` = 'nee' AND `goedgekeurd` = 'ja'") or die(mysql_error()); $counttotal = mysql_num_rows($counttotal); // tell alle records $total_pages = ceil($counttotal / $max); // dive the total, by the maximum results to show if(mysql_num_rows($result) == 0) { echo "Er zijn nog geen complimentjes verstuurd! \n"; } else { while($row = mysql_fetch_assoc($result)) { echo "
"; } if($page > 1){ // is de pagina hoger dan 1? $prev = ($page - 1); // ja neem dan de pagina -1 echo 'vorige'; // vorige pagina link } for($i = 1; $i <= $total_pages; $i++) // for each page number { if($page == $i) // if this page were about to echo = the current page { echo ''.$i.''; // echo the page number bold }else{ echo ' '.$i.' '; // echo a link to the page } } if($page < $total_pages){ // is there a next page? $next = ($page + 1); // if so, add 1 to the current echo 'volgende'; // echo the next page link } } ?> Een complimentje voor iemand op de Nationale Complimentensite? Helaas! Door VGA niet meer mogelijk! |
![]() ![]() ![]() ![]() ![]() |
|||||||||
![]() |