请一些人帮我这个iv被困2天!!警告:mysqli_num_rows()期望参数1为mysqli_result,给定布尔值 [英] Please can some one help me with this iv been stuck for 2 days !! Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given
本文介绍了请一些人帮我这个iv被困2天!!警告:mysqli_num_rows()期望参数1为mysqli_result,给定布尔值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直得到同样的错误,我已经浏览了这个网站和许多其他人试图找到解决方案,请你们其中一个人帮我这里是代码
请注意$ link我已删除并替换了主机名,用户名和密码以保证安全原因
i keep getting the same error i have looked through this website and many others trying to find a solution please can one of yous help me here is the code
please note on $link i have removed and replaced the hostnamem, username and password for security reasons
$link = mysqli_connect('****HOSTNAME*****', '***USERNAME****', '**PASSWORD**', 'a8834432_website')or die("cannot connect" . mysqli_connect_error());
$usr = $_POST['user'];
$pas = $_POST['pass'];
if ($usr == "")
{
header("Location: ../secure.php?error=E3");
die();
}
else if ($usr != "")
{
$result = mysqli_query($link, "SELECT * FROM 'website' WHERE 'user' = $usr");
//echo($result);
///////PROBLEM STARTS HERE ////////////
if (mysqli_num_rows($result) > 0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
echo "id: " . $row["user"];
}
}
}
?>
推荐答案
我出于安全原因删除并替换了主机名,用户名和密码
link i have removed and replaced the hostnamem, username and password for security reasons
link = mysqli_connect(' **** HOSTNAME *****',' *** USERNAME ** **',' ** PASSWORD **',' a8834432_website')或死亡( 无法连接 .mysqli_connect_error());
link = mysqli_connect('****HOSTNAME*****', '***USERNAME****', '**PASSWORD**', 'a8834432_website')or die("cannot connect" . mysqli_connect_error());
usr =
usr =
这篇关于请一些人帮我这个iv被困2天!!警告:mysqli_num_rows()期望参数1为mysqli_result,给定布尔值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文