<? echo"case('index'):
echo'<div class=head>Заголовок</div><hr>
<a href="index.php?mod=adds">Добавить</a><hr>';
$id = isset($_GET['id']) ? intval($_GET['id']) : '';
if(empty($id)) {
$query = "SELECT name,id
FROM statx LIMIT 0,20";
$res = mysql_query($query) or die("error sql : $query");
while($row = mysql_fetch_assoc($res)) {
$id = $row['id'];
$name = $row['name'];
echo "<a href = '?id=$id'>$name</a><br />";
} } else {
$query = "SELECT name
FROM statx;
WHERE id = $id";
$res = mysql_query($query) or die("error sql : $query");
if(mysql_num_rows($res) == 0) die('NOT FOUND');
$text = mysql_result($res , 0);
echo $text;
}
break;
"; ?>