Jump to content

error ! please help


Glenskie

Recommended Posts

this is code for a comment system on my site and it keeps showing this "Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in line 62 (which would be the while($row = mysql_fetch_array($sql_blabs)){ line like line 3)"

 

<?php
$sql_blabs = mysql_query("SELECT id, mem_id, the_blab, blab_date, blab_type FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 30");

while($row = mysql_fetch_array($sql_blabs)){

$blabid = $row["id"];

$sql_comments= mysql_query("SELECT * FROM blab_comments WHERE blab_id='$blabid'ORDER BY id ASC");
$count_comment = mysql_num_rows($sql_comments);
if($count_comment > 0){
while($row2 = mysql_fetch_array($sql_comments)){

    $comment_mem_id=$row2['mem_id'];
$sql_comment_user = mysql_query("SELECT username FROM myMembers WHERE id='$comment_mem_id'LIMIT 1");
    while($row3 = mysql_fetch_array($sql_comment_user)){$comment_user = $row3['username'];}

$comment_txt = $row2['the_comment'];
$comment_date = $row2['comment_date'];
$convertedTime = ($myObject -> convert_datetime($comment_date));
    $whenComment = ($myObject -> makeAgo($convertedTime));

    $DisplayCommentList .= '
<div style="background-color:#f0f9fe";border-bottom:1px dashed #3A69B6; padding:5px; width:auto;">
<strong>'.$comment_user.'</strong><br/>'.$comment_txt.' <br/> ·'.$whenComment.'·</div> ';

}
}else{
$DisplayCommentList ="";
} 
$blabber_id = $row["mem_id"];
$the_blab = $row["the_blab"];
$the_blab = ($activeLinkObject -> makeActiveLink($the_blab));
$blab_date = $row["blab_date"];
$convertedTime = ($myObject -> convert_datetime($blab_date));
    $whenBlab = ($myObject -> makeAgo($convertedTime));
$blab_date = $row["blab_date"];
$blab_type = $row["blab_type"];

    

			$blabberDisplayList .= '
		        <table width="100%" style="background-color:#CCCCCC; border:#999 1px solid; border-top:none;" cellpadding="4" ">
				<tr>
				<td width="7%" rowspan="2" valign="top" bgcolor=##f0f9fe">' . $blab_pic . '</td>
				<td width="93%" bgcolor="#F9F9F9" valign="top" style="line-height:1.5em;">
				<span class="liteGreyColor textsize9"> ' . $whenBlab . ' <a href="profile.php?id=' . $blabber_id . '"><strong>' . $mainNameLine . '</strong></a></span><br />
				 <span>' . $the_blab . '</span>

            </td>
            </tr>
		<tr>
		<td style="line-height:1.5em;" valign="top">
		'.$DisplayCommentList.'
		<div id="new_comment '.$blabid.'" style="display:none;">

		<textarea id="Comment'.$blabid.'"></textarea>
		</div>


		<br/>
		<input type="submit" value="Send Comment" onclick="javascript:SendComment(\''.$blabid.'\');" />

		</td>
		</tr>
		</table>';

}
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/248713-error-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.