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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.