AppServer中的查询错误 [英] Query Error in AppServer
问题描述
我在数据库查询中遇到问题。我的查询是:
I have problem in database query. The query that I have is:
SELECT
DATE_FORMAT(LAST_DAY(NEWSP_MONTH),'%d') as Last,
MIN(NPDAY) AS NPDA, ifnull(MAX(NPDAY),0)+01 AS NPDAY, np.NEWSP_RACKNO, np.NEWSP_MONTH, np.NEWSPID FROM
newspaper AS np, newspaper_days AS npd
WHERE np.NEWSPID = npd.NEWSPID AND
np.NPID =$newspaper AND np.CITYID = $city AND np.NEWSP_MONTH = $monthYear
此查询在Wamp中成功执行,版本详细信息为:
Apache版本:2.4.4
PHP版本:5.4.12
MySQL版本:5.6.12
但是在Apache服务器上的相同查询会返回此错误:
警告:mysql_num_rows():提供的参数不是 D:\AppServ \ www.harchives\app\archive\checkmonth.php 中有效的MySQL结果资源line 68
Apache服务器的版本详细信息如下:
Apache版本:2.2.8
PHP版本:5.2.6
MySQL版本:5.0.51b
在第68行上面有一个由上述查询组成的变量。
非常感谢帮助,谢谢。
This query executes successfully in Wamp where version details are:
Apache version: 2.4.4
PHP version: 5.4.12
MySQL version: 5.6.12
But the same query, on an Apache server, returns this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\archives\app\archive\checkmonth.php on line 68
The version details of the Apache server are:
Apache version: 2.2.8
PHP version: 5.2.6
MySQL version: 5.0.51b
On line 68 there is a variable consisting of the above mentioned query.
Help is greatly appreciated, thanks.
推荐答案
newspaper AND n p.CITYID =
newspaper AND np.CITYID =
city AND np.NEWSP_MONTH = < span class =code-keyword>
city AND np.NEWSP_MONTH =
monthYear
monthYear
此查询在Wamp中成功执行版本细节:
Apache版本:2.4.4
PHP版本:5.4.12
MySQL版本:5.6.12
但是在Apache服务器上的相同查询会返回此错误:
警告:mysql_num_rows():提供的参数不是 D中的有效MySQL结果资源:\ AppServ \ www.harchives \ app \ archive\checkmonth.php 在线 68
Apache服务器的版本详细信息如下:
Apache版本:2.2.8
PHP版本:5.2.6
MySQL版本:5.0.51b
在第68行上面有一个由上述人组成的变量查询。
非常感谢帮助,谢谢。
This query executes successfully in Wamp where version details are:
Apache version: 2.4.4
PHP version: 5.4.12
MySQL version: 5.6.12
But the same query, on an Apache server, returns this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\archives\app\archive\checkmonth.php on line 68
The version details of the Apache server are:
Apache version: 2.2.8
PHP version: 5.2.6
MySQL version: 5.0.51b
On line 68 there is a variable consisting of the above mentioned query.
Help is greatly appreciated, thanks.
这篇关于AppServer中的查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!