Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given .... on line 38
вот код файла :
<div class="rightside" id="equal-height">
<div class="navbar">
<div class="title">Новые записи</div>
<div id="tabs">
<ul>
<li><a href="#tabs-1" class="tab">Форум</a></li>
<li><a href="#tabs-2" class="tab2">Библиотека</a></li>
<div class="both"></div>
</ul>
<!-- Вывод активности тем форума (код от ValekS) -->
<div id="tabs-1">
<?php
$req_forum = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `time` DESC LIMIT 5");
for ($i = 0; $res_forum = mysql_fetch_assoc($req_forum); ++$i) {
$user_f = mysql_fetch_assoc(mysql_query("SELECT `from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res_forum['id'] . "' ORDER BY `time` DESC LIMIT 1"));
$total_f = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res_forum['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
$endp_f = ceil($total_f / $kmess);
echo '<div class="inf">';
echo '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $res_forum['id'] . '">' . $res_forum['text'] . '</a> <span class="count"> ' . $total_f . ' </span>';
if ($endp_f > 1) {
echo '<a href="' . $set['homeurl'] . '/forum/index.php?id=' . $res_forum['id'] . '&page=' . $endp_f . '"> >></a>';
}
echo '<div class="dopinfo"> <i class="fi-torso-business"></i> '.$user_f['from'].' <i class="fi-calendar"></i> ' . functions::display_date($res_forum['time']) . ' </div>';
echo '</div>';
}
?>
</div>
<!-- Вывод последних статьей библиотеки (код от ValekS) -->
<div id="tabs-2">
<?php
$req_lib = mysql_query("SELECT * FROM `lib` WHERE `type`='bk' ORDER BY `time` DESC LIMIT 5 ");
for ($i = 0; $res_lib = mysql_fetch_assoc($req_lib); ++$i) {
echo '<div class="inf">';
echo '<a href="' . $set['homeurl'] . '/library/index.php?id='.$res_lib['id'].'">'.$res_lib['name'].'</a>';
$komm_lib = mysql_num_rows(mysql_query("select `id` from `lib` where type = 'komm' and refid = '" . $res_lib['id'] . "'"));
echo '<div class="dopinfo"><i class="fi-comments"></i> Комментарии '.$komm_lib.' ';
echo '<i class="fi-page-eyes"></i> Просмотров: '.$res_lib['count'].'</div>';
echo '</div>';
}
?>
</div>
</div> <!-- #tabs -->
<div class="title">Новые юзеры</div>
<?php
$arg = array('iphide' => 1);
$sql = mysql_query("select * from `users` order by `id` desc limit 8");
while($row = mysql_fetch_assoc($sql)) {
echo '<div class="users"> <p> ' . functions::display_user($row, $arg) . '</p></div>';
}
?>
</div>
</div>
как исправить? (взято из Web App темы, файл rightside.php)