<?php require_once('funct.php'); require_once('navigator.php'); echo up('СверхБлог'); switch($_GET['act']) { default: $navig = new navigation(); $blog = mysql_result(mysql_query("SELECT COUNT(*) FROM blog"), 0); if(!$blog) { echo '<div class="menu">Статей пока нет.</div>'; } else { $sql = mysql_query("SELECT * FROM blog ORDER BY id DESC '.$navig->limit()); while($res = mysql_fetch_assoc($sql)) { echo '<div class="menu">'.$res['title'].' ('.date('d.m.y/H:i', $res['time']).')<br />'; echo mb_substr($res['msg'], 0, 50, 'UTF-8'); echo '...| <a href="index.php?act=view;file='.$res['id'].'">Читать всё »</a><br /></div>'; } $navig->view(); } break; case 'view': $file = (int)$_GET['file']; $res = mysql_fetch_assoc(mysql_query("SELECT * FROM blog WHERE id='.$file.'")); echo '<div class="menu">'; echo 'Заголовок: '.$res['title']; echo 'Текст: '.$res['msg']; echo 'Дата добавления: '.date('d.m.y/H:i', $res['time']).'</div>'; } echo down($copy); ?>
<?php $sql = mysql_query('SELECT * FROM blog ORDER BY id DESC '.$navig->limit());
dont give me names (22 Сентября 2010 / 20:32) $sql = mysql_query("SELECT * FROM blog ORDER BY id DESC '.$navig->limit()); кавычку одинарную на двойную замени