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
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.