Glenskie Posted October 8, 2011 Share Posted October 8, 2011 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>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/248713-error-please-help/ Share on other sites More sharing options...
silkfire Posted October 8, 2011 Share Posted October 8, 2011 Use "echo mysql_error();" to find out the exact error message, please. Quote Link to comment https://forums.phpfreaks.com/topic/248713-error-please-help/#findComment-1277308 Share on other sites More sharing options...
Glenskie Posted October 8, 2011 Author Share Posted October 8, 2011 Unknown column 'blab_type' in 'field list' is what it is Quote Link to comment https://forums.phpfreaks.com/topic/248713-error-please-help/#findComment-1277309 Share on other sites More sharing options...
awjudd Posted October 8, 2011 Share Posted October 8, 2011 Then in your first query remove blab_type from the SELECT because it isn't a valid field. ~juddster Quote Link to comment https://forums.phpfreaks.com/topic/248713-error-please-help/#findComment-1277311 Share on other sites More sharing options...
Glenskie Posted October 9, 2011 Author Share Posted October 9, 2011 the comment box wont show up! just blank Quote Link to comment https://forums.phpfreaks.com/topic/248713-error-please-help/#findComment-1277318 Share on other sites More sharing options...
awjudd Posted October 9, 2011 Share Posted October 9, 2011 That statement means nothing to us. We need more information if you want us to help. That said, in my last post I defined the exact problem. ~juddster Quote Link to comment https://forums.phpfreaks.com/topic/248713-error-please-help/#findComment-1277423 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.