<?php
include "config.php";
$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
$res = mysql_query('SELECT * FROM `news` WHERE `id` = ' . $id);
mysql_select_db($dbname) || die('Нет базы');
$row = mysql_fetch_array($res);
echo '<div>' .$row['text']. '</div>';
?>
<a href=news.php/id=%s.html>Подробнее</a>
<?php
include "config.php";
$id = (isset($_GET['id']) && is_numeric($_GET['id'])) ? (int) $_GET['id'] : 0;
mysql_select_db($dbname) or die('Нет базы');
$res = mysql_query('SELECT * FROM `news` WHERE `id` = '.$id.' ');
while ($row = mysql_fetch_array($res, MYSQL_ASSOC))
{
echo '<div>' .$row["text"]. '</div>';
}
?>
<a href="news.php?id=1">Подробнее</a>