Mam problem napisałem sobie oto taki jeszcze w zasadzie nie skończony skrypt wyświetlania newsów na stronie i mam problem bo stronnicowanie coś mi nie działa tak jakbym tego chciał zwyczajnie wyświetla mi o jedną stronę za dużo w dodatku pustą... jak mogę się jej pozbyć ?
<?php
$news = "SELECT SQL_CALC_FOUND_ROWS * FROM news ORDER BY id DESC LIMIT ". mysql_escape_string((int
)$_GET['porcja'] *limit_news
).",".limit_news
;
{
<table valign="top" cellspacing="0" cellpadding="0">
<tr><td><img src="img/news-1.png"></td></tr>
<tr style="background-image: url(img/news-2.jpg);"><td>
<table style="margin-left: 7px;" valign="top" cellspacing="0" cellpadding="0">
<tr><td style="background-repeat: no-repeat; padding-left: 10px; color: #151515; font-family: Arial; font-size: 14px; width: 490px; height: 45px; background-image: url(img/bg-title.png);">
<table cellspacing="0" cellpadding="0"><tr>
<td><img src="img/icons/'.$news_row['icon'].'"></td>
<td>
<font style="color: #151515; font-size: 14px;"><b>'.$news_row['title'].'</b></font><br> <font style="color: #505050; font-size: 11px;">Autor: <b>'.$news_row['author'].'</b> '.$news_row['date'].' '.$news_row['time'].'</font>
</td></tr></table></td></tr>
<tr><td><table style="margin-right: 16px; margin-top: 10px; margin-left: 9px;" cellspacing="0" cellpadding="0">
<tr><td style="text-align: justify; color: #FFFFFF; font-family: Arial; font-size: 11px;"><img style="margin-top: 3px;margin-right: 5px;" align="left" src="img/'.$news_row['img1'].'">'.$news_row['info1'].'<br><br></td></tr>
<tr><td style="padding-left: 15px; color: #FFFFFF; font-family: Arial; font-size: 11px; width: 473px; height: 31px; background-image: url(img/bg-cmt.jpg); background-repeat: no-repeat;">Wyświetleń: <font color="#ffc000">'.$news_row['vievs'].'</font> Komentarzy: <font color="#ffc000">'.$news_row['comments'].'</font> <font style="padding-left: 210px;"><a style="color: #ffc000;" href="">czytaj więcej..</a></font></td></tr>
</table></td></tr>
</table>
</td></tr>
<tr><td><img src="img/news-3.png"></td></tr>
</table>';
}
//Pobieramy ilosc danych w bazie
$news = "SELECT FOUND_ROWS() as Ilosc";
if($_GET['porcja']>0){
echo '<a href="?porcja='.($_GET['porcja']-1).'">wstecz</a> '; }
for($i = 0;$i<=floor($iloscWpisow/limit_news
);$i++){ echo '<a href="?porcja='.($i).'">[ '.($i+1).' ]</a> '; }
if($_GET['porcja']<floor($iloscWpisow/limit_news)){
echo ' <a href="?porcja='.($_GET['porcja']+1).'">dalej</a>'; }
?>