(26 май 2015, 04:53) (
0/
0)
[
0]
<?php
$all_theme = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_THEME.""
;
if (empty($all_theme)) {
echo 'Темы не созданы';
} else {
$sql = DB::$dbs->query("SELECT * FROM ".FORUMS_THEME." ORDER BY `activ` DESC LIMIT 5, ".$config['write']['forum_post'].""
;
while($theme = $sql -> fetch()) {
$posts = DB::$dbs->querySingle("SELECT COUNT(`id`) FROM ".FORUMS_POST." WHERE `theme_id` = ? ", array($theme['id']));
echo '<a href="/forum/'.$theme['forum_id'].'/'.$theme['forumc_id'].'/'.$theme['id'].'/">'.$theme['name'].' '.$posts.'</a>';
}
}
?>
(26 май 2015, 04:46) (
0/
0)
[
0]
Енот,
У неё PDO, а ты ей mysql написал.
Для автора: сейчас напишу.