-3

我在这里找到的脚本有一些问题:http : //www.phpkode.com/source/s/proxier/proxier/Proxier.class.php 不能让它工作,我创建了数据库,cron 文件但是运行 cron 后我仍然收到一些错误:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/.../Proxier.class.php on line 265

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/.../Proxier.class.php on line 352

我需要一些帮助来了解如何使脚本正常工作。

4

3 回答 3

1

The docs for mysql_query says:

"For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error."

Your error says that the argument is not a resource, which tells me it is returning FALSE due to some error. My guess is the table doesn't exist or there is some typo in the query. Without more information on the database we can't help much more than that.

The docs also say:

"mysql_query() will also fail and return FALSE if the user does not have permission to access the table(s) referenced by the query."

So depending on what user is running the process you may not have permission to access the table.

于 2012-10-11T22:28:59.480 回答
0

通过这样做显示错误:

// The link you provided: Line - 264
// Modify it to this:
$res = mysql_query("select ...") or die("Error: ". mysql_error());

这样你就会知道出了什么问题。在我看来,查询只是失败了,因为您的表没有相同的字段。但是让错误告诉你。

于 2012-10-11T22:31:19.837 回答
0

看起来配置不正确,请确保传递数据库名称、用户、密码和表。

您收到的错误是因为 mysql_query 失败,或者是因为连接失败或表不存在或与它的预期匹配(即列 ip、time_added、active)。

于 2012-10-11T22:32:54.113 回答