Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there can anyone help me im trying to echo the results from my MySQL table
and i keep getting this error

mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in



Code:


<pre lang="php">$uuid = $_REQUEST[&#39;uuid&#39;];
//mysqli_query($link, &quot;SELECT * FROM website WHERE user = &#39;$usr&#39;&quot;);
$result = mysqli_query($link, &quot;SELECT * FROM AlertPack WHERE Key = &#39;$uuid&#39;&quot;);
if (mysqli_num_rows($result) &gt; 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result))
{
echo($row[&quot;Type&quot;] . &quot;*&quot; . $row[&quot;Message&quot;] . &quot;$&quot; . $row[&quot;Time&quot;]);
}
}

?&gt;</pre>
Posted

Your query is probably wrong and returning a false boolean value.
Try:
$result = mysqli_query($link, "SELECT * FROM AlertPack WHERE Key = '$uuid'") or die();
 
Share this answer
 
sorted it :) can you see a problem with this at all
mysqli_query($link, "UPDATE AlertPack Type = '$type', Message = '$msg' WHERE Key = '$uuid'" or mysqli_error($link));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900