我该怎么做才能修复警告:mysqli_fetch_array()要求参数1为mysqli_result,第55行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ [英] What can I do to fix warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\view.php on line 55

查看:217
本文介绍了我该怎么做才能修复警告:mysqli_fetch_array()要求参数1为mysqli_result,第55行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的一个作业创建一个基本网站,该网站必须查看我在MyPHPAdmin中创建的数据库,添加和删除记录。



在第55行的View.php中:



while($ row = mysqli_fetch_array( $ result))。



出现以下错误:



警告:mysqli_fetch_array()需要参数1成为mysqli_result,第55行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,这个错误?



我尝试了什么:



尝试使用网站类似于StackOverflow这样的一个,并没有找到一个解决我的问题的解决方案以及我理解的一个解决方案,因为我是PHP的初学者。

I am creating a basic website for one of my assignments, which must view a database I created in MyPHPAdmin , add and delete a record.

In my View.php on line 55 which is:

while($row = mysqli_fetch_array( $result )).

The following error appears:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\View.php on line 55

Why is this happening and what can I do to resolve this error ?

What I have tried:

Tried using sites similar to this one such as StackOverflow and have not found a solution that answers my question as well as one that I understand as I am a beginner in PHP.

推荐答案

row = mysqli_fetch_array(
row = mysqli_fetch_array(


result))。



出现以下错误:



警告:mysqli_fetch_array()要求参数1为mysqli_result,在C:\ xampp \\\\\\\\\\\\\\\\\\第55行



为什么会发生这种情况,我该怎么做才能解决这个错误?



我尝试了什么:



尝试使用与此类似的网站,例如StackOverflow,并且没有找到解决方案来回答我的问题以及我理解为我是PHP的初学者。
result )).

The following error appears:

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\View.php on line 55

Why is this happening and what can I do to resolve this error ?

What I have tried:

Tried using sites similar to this one such as StackOverflow and have not found a solution that answers my question as well as one that I understand as I am a beginner in PHP.


你必须检查前一个 PHP:mysqli :: query - Manual [ ^ ]呼吁成功。如果失败则返回布尔值 false 而不是 mysqli_result 对象。



请参阅上面的链接,了解如何检查错误并报告错误。打印错误消息有助于了解出现了什么问题(通常是SQL语法错误)。
You have to check the return value of the previous PHP: mysqli::query - Manual[^] call for success. If that fails it returns a boolean false instead of a mysqli_result object.

See the above link on how to check for errors and report them. Printing the error message is useful to know what went wrong (usually an SQL syntax error).


这篇关于我该怎么做才能修复警告:mysqli_fetch_array()要求参数1为mysqli_result,第55行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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