警告:mysql_fetch_array():提供的参数不是有效的MySQL结果源 [英] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result source

查看:75
本文介绍了警告:mysql_fetch_array():提供的参数不是有效的MySQL结果源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

展开 | 选择 | Wrap | 行号

推荐答案

您需要使用结果资源来提供mysql_ *函数。简单地传递查询字符串就不行了。

You need to suply the mysql_* functions with a result resource. Simply passing it the query string will not do.

展开 | 选择 | Wrap | 行号


我知道这已经说过,但是花了我一秒钟来解决这个问题。你的代码应该是:
I know this has been already said, but took me a second to work out the problem. Your code should be:
展开 | 选择 | Wrap | 行号


@TheServant

Deja vu :)

@TheServant


如果如果您将数据库期望为int类型的变量包围起来,则会出现错误。因此,只有字符串变量才需要引用。

@TheServant


我想他只是扔了它一起快速向我们展示。
@TheServant
Deja vu :)

@TheServant
If you surround a variable that your database expects to be an int type, you will get an error. So only variables that are strings need quotes.

@TheServant
I think he just threw it together quickly to show us.


这篇关于警告:mysql_fetch_array():提供的参数不是有效的MySQL结果源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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