File size: 944B
<?php
// выводим верх страницы
include 'verh.php';
$p=@intval($_GET['p']);
$sql = mysql_query("SELECT *, DATE_FORMAT(date, '%d.%m.%y') AS sdate FROM inet_news ORDER BY date DESC LIMIT $p,$limit");
echo "<div class=\"main_bottom\" align=\"center\"><b>Новости</b>";
echo "</div> ";
while($news = mysql_fetch_array($sql))
{
echo "<b>".$news['sdate']."</b><br/>";
echo "".$news['text']."<br/>";
echo "<div class=\"b\">";
}
if(mysql_affected_rows() == 0)
{
echo("Новостей нет.<br/>");
}
$next = $p+$limit;
$prev = $p-$limit;
if ($p>0) {
echo "<a href=\"news.php?p=$prev\">Назад</a>";
}
list($c)=mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM inet_news WHERE id"));
if ($p+$limit<$c) {
echo " <a href=\"news.php?p=$next\">Далее</a><br/>";
}
echo "<div class=\"info\">
»<a href=\"index.php\">На главную</a><br/>";
// выводим низ страницы
include 'niz.php';
?>