{% else-1 %}
(26 ноя 2012, 16:21) (0/0) [0]
<?php
echo \'<div class=\"menu\">\';
$limit = 3; // количество тем
$req = mysql_query(\"SELECT `id`, `text` FROM `forum` WHERE `type`=\'t\' AND `close`!=\'1\' ORDER BY `time` DESC LIMIT $limit \"*; // запрос
while($res = mysql_fetch_array($req)){

$colmes = mysql_query(\"SELECT COUNT(*) FROM `forum` WHERE `type`=\'m\' AND `refid`=\'\" . $res[\'id\'] . \"\'\"*;
$colmes1 = mysql_result($colmes, 0);

echo \'<small> >> <a href=\"/forum/?id=\'.$res[\'id\'].\'\">\'.$res[\'text\'].\'</a> [\' . $colmes1 . \']</small><br/>\'; // вывод темы

}
echo \'</div>\';
?>


вродь
  • 1 из 1