我如何修复mysqli_num_rows()期望参数1为mysqli_result,boolean给出 [英] How do I fix mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in

查看:97
本文介绍了我如何修复mysqli_num_rows()期望参数1为mysqli_result,boolean给出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我可以帮助我试图回应我的MySQL表格中的结果

我一直收到此错误



mysqli_num_rows ()期望参数1为mysqli_result,布尔值在







代码:





< pre lang =" php"> $ uuid = $ _REQUEST [&#39; uuid&#39;]; < br $>
// 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){

//每行输出数据

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>

解决方案

uuid =


_REQUEST [&# 39; uuid&#39;];

// mysqli_query(


link,& quot; SELECT * FROM website WHERE user =&#39;

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>

解决方案

uuid =


_REQUEST[&#39;uuid&#39;];
//mysqli_query(


link, &quot;SELECT * FROM website WHERE user = &#39;


这篇关于我如何修复mysqli_num_rows()期望参数1为mysqli_result,boolean给出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆