hya i am getting the following error message
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/jktempla/public_html/WEBINTERSECT/template_status.php on line 20
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/jktempla/public_html/WEBINTERSECT/template_status.php on line 21
can anyone help and see whats causing it im lost ty
<?php
$status_ui = "";
$statuslist = "";
if($isOwner == "yes"){
$status_ui = '<textarea id="statustext" onkeyup="statusMax(this,250)" placeholder="What's new with you '.$u.'?"></textarea>';
$status_ui .= '<button id="statusBtn" onclick="postToStatus(\'status_post\',\'a\',\''.$u.'\',\'statustext\')">Post</button>';
} else if($isFriend == true && $log_username != $u){
$status_ui = '<textarea id="statustext" onkeyup="statusMax(this,250)" placeholder="Hi '.$log_username.', say something to '.$u.'"></textarea>';
$status_ui .= '<button id="statusBtn" onclick="postToStatus(\'status_post\',\'c\',\''.$u.'\',\'statustext\')">Post</button>';
}
?><?php
$sql = "SELECT s.*, u.avatar
FROM status AS s
LEFT JOIN users AS u ON u.username = s.author
WHERE (s.account_name = '$u' AND s.type='a')
OR (s.account_name='$u' AND s.type='c)'
ORDER BY s.postdate DESC LIMIT 20";
$query = mysqli_query($db_conx, $sql);
$statusnumrows = mysqli_num_rows($query);
while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {
$statusid = $row["id"];
$account_name = $row["account_name"];
$author = $row["author"];
$postdate = $row["postdate"];
//
$avatar = $row["avatar"];
$user_image = '<img src="user/'.$author.'/'.$avatar.'" width="50" height="50" border="0" />';
//
$data = $row["data"];
$data = nl2br($data);
$data = str_replace("&","&",$data);
$data = stripslashes($data);
$statusDeleteButton = '';
if($author == $log_username || $account_name == $log_username ){
$statusDeleteButton = '<span id="sdb_'.$statusid.'"><a href="#" onclick="return false;" onmousedown="deleteStatus(\''.$statusid.'\',\'status_'.$statusid.'\');" title="DELETE THIS STATUS AND ITS REPLIES">delete status</a></span> ';
}
// GATHER UP ANY STATUS REPLIES
$status_replies = "";
$sq12 = "SELECT s.*, u.avatar
FROM status AS s
LEFT JOIN users AS u ON u.username = s.author
WHERE s.osid = '$statusid'
AND s.type='b'
ORDER BY postdate ASC";
$query_replies = mysqli_query($db_conx,$sq12);
$replynumrows = mysqli_num_rows($query_replies);
if($replynumrows > 0){
while ($row2 = mysqli_fetch_array($query_replies, MYSQLI_ASSOC)) {
$statusreplyid = $row2["id"];
$replyauthor = $row2["author"];
$replydata = $row2["data"];
//
$avatar2 = $row2["avatar"];
$user_image2 = '<img src="user/'.$replyauthor.'/'.$avatar.'" width="50" height="50" border="0" />';
//
$replydata = nl2br($replydata);
$replypostdate = $row2["postdate"];
$replydata = str_replace("&","&",$replydata);
$replydata = stripslashes($replydata);
$replyDeleteButton = '';
if($replyauthor == $log_username || $account_name == $log_username ){
$replyDeleteButton = '<span id="srdb_'.$statusreplyid.'"><a href="#" onclick="return false;" onmousedown="deleteReply(\''.$statusreplyid.'\',\'reply_'.$statusreplyid.'\');" title="DELETE THIS COMMENT">remove</a></span>';
}
$status_replies .= '<div id="reply_'.$statusreplyid.'" class="reply_boxes"><div><b>Reply by <a href="user.php?u='.$replyauthor.'">'.$replyauthor.'</a> '.$replypostdate.':</b> '.$replyDeleteButton.'<br /> '.$user_image.'<br /> '.$replydata.'</div></div>';
}
}
$statuslist .= '<div id="status_'.$statusid.'" class="status_boxes"><div><b>Posted by <a href="user.php?u='.$author.'">'.$author.'</a> '.$postdate.':</b> '.$statusDeleteButton.' <br />'.$user_image.' <br />'.$data.'</div>'.$status_replies.'</div>';
if($isFriend == true || $log_username == $u){
$statuslist .= '<textarea id="replytext_'.$statusid.'" class="replytext" onkeyup="statusMax(this,250)" placeholder="write a comment here"></textarea><button id="replyBtn_'.$statusid.'" onclick="replyToStatus('.$statusid.',\''.$u.'\',\'replytext_'.$statusid.'\',this)">Reply</button>';
}
}
?>