mysql_query 返回布尔值还是字符串?
由于某种原因,当我运行应该返回要使用 mysql_fetch_array 解析的数组的 $result=mysql_query(...)
时,我不断收到返回值的错误for $result
是字符串或布尔值,mysql_fetch_array()
无法使用它。多年来我一直在我的服务器上运行相同的查询,但由于某种原因它最近停止工作。
这是示例代码:
$result=mysql_query("SELECT * FROM `patient_list`");
while ($row=mysql_fetch_array($result)) {
...
}
我最近升级到了最新版本的 wamp。这可能有什么关系吗?有什么想法吗?
For some reason when I run a $result=mysql_query(...)
that should return an array to be parsed with mysql_fetch_array
, I keep getting an error that the value returned for $result
is either a string or boolean, which mysql_fetch_array()
can't work with. I've been running the same query on my server for years and for some reason it stopped working recently.
here's the sample code:
$result=mysql_query("SELECT * FROM `patient_list`");
while ($row=mysql_fetch_array($result)) {
...
}
I recently upgraded to the newest version of wamp. might that have anything to do with it? Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
此错误意味着 mysql_query 的结果无效。请
在调用 mysql_query 之后放置
This error means taht result of mysql_query is not valid.Please place
after you call mysql_query
您的问题可能是访问/数据库不存在/任何内容
始终检查查询运行是否正确执行您的查询,如下所示:
mysql_query 文档
Your problem could be access / database doesn't exist / anything
Always check the query runs correctly execute your query like this :
Documentation for mysql_query
试试这个:
Try this: