0

I i get the following error in a script im using has anyone got any ideas what it could be ty jan x
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/letsswin/public_html/template_status.php on line 47

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home/letsswin/public_html/template_status.php on line 47

Heres the code for that section

// GATHER UP ANY STATUS REPLIES
$status_replies = "";
$sql2 = "SELECT s.*, u.avatar
FROM status 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, $sql2);
$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"];
2
Contributors
3
Replies
17
Views
2 Years
Discussion Span
Last Post by janicemurby
0

Hi,

when the query fails MySQLi will return FALSE, so add mysqli_error() to get some information about it.

I think there is an ambiguous column error, which means the two tables have at least a column with the same name, for example postdate.

0

i put the mysqli_error() in

$status_replies = "";
$sql2 = "SELECT s.*, u.avatar
FROM status 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, $sql2);
$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"];
$mysqli_error();

and im getting Parse error: syntax error, unexpected T_IF in /home/letsswin/public_html/template_status.php on line 54

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.