Warning: mysql_result() expects parameter 1 to be resource, boolean given in /home/u587244903/public_html/public_html/pages/mainmenu.php on line 109
Solution pls.....
Solution pls.....
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `kiemduyet` = '1' AND kedit = '0' AND `close`!='1'"), 0);
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `time` DESC LIMIT $start," . $settings['totalThemes']);
while (($res = mysql_fetch_assoc($req)) !== false) {
if ($res['close']) $themesOut .= '<div class="forum_del">';
else $themesOut .= $i % 2 ? '<div class="menu">' : '<div class="menu">';
$nickUser = mysql_fetch_assoc(mysql_query("SELECT `user_id`,`from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` DESC LIMIT 1"));
$totalPosts = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `kiemduyet` = '1' AND kedit = '0' AND `close`!='1'"), 0);
if($total[0]>0){ //new if
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `time` DESC LIMIT $start," . $settings['totalThemes']);
while (($res = mysql_fetch_assoc($req)) !== false) {
if ($res['close']) $themesOut .= '<div class="forum_del">';
else $themesOut .= $i % 2 ? '<div class="menu">' : '<div class="menu">';
$nickUser = mysql_fetch_assoc(mysql_query("SELECT `user_id`,`from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` DESC LIMIT 1"));
$totalPosts = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
}// close if
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `kiemduyet` = '1' AND kedit = '0' AND `close`!='1'"), 0);
if($total[0]>0){ //new if
$req = mysql_query("SELECT * FROM `forum` WHERE `type`='t'" . ($rights >= 7 ? '' : " AND `close`!='1'") . " ORDER BY `time` DESC LIMIT $start," . $settings['totalThemes']);
while (($res = mysql_fetch_assoc($req)) !== false) {
if ($res['close']) $themesOut .= '<div class="forum_del">';
else $themesOut .= $i % 2 ? '<div class="menu">' : '<div class="menu">';
$nickUser = mysql_fetch_assoc(mysql_query("SELECT `user_id`,`from` FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` DESC LIMIT 1"));
$totalPosts = mysql_result(mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type`='m' AND `refid`='" . $res['id'] . "'" . ($rights >= 7 ? '' : " AND `close` != '1'")), 0);
}// close if
$total = mysql_fetch_array((mysql_query("SELECT COUNT(*) FROM `forum` WHERE `type` = 't' AND `kiemduyet` = '1' AND kedit = '0' AND `close`!='1'"));
$total = $total[0];
Comment