Re: Parse error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are further problems with the mySQL query:

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near ') AND
CURDATE() <= DATE(FROM_UNIXTIME(1239508800)), 1, 0), IF(CURDATE() >=
DATE'

This is the whole query, what am I missing / doing wrong?

SELECT GREATEST( IF(CURDATE() >=
DATE_SUB(CONCAT(DATE(FROM_UNIXTIME(1239508800)), INTERVAL LEAST(14,
(SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE seasonal_use
= 1)) DAY) AND CURDATE() <= DATE(FROM_UNIXTIME(1239508800)), 1, 0),
IF(CURDATE() >= DATE_SUB(CONCAT(YEAR(CURDATE()), '-12-25'), INTERVAL
LEAST(14, (SELECT COUNT(*) FROM `verse_of_the_day_Bible_verses` WHERE
seasonal_use = 2)) DAY) AND CURDATE() <= YEAR(CURDATE()), '-12-25'), 2,
0) ) AS verse_application


On Thu, 2009-09-24 at 15:39 +1000, Chris wrote:
> Ron Piggott wrote:
> > Let me try this is a different way.  
> > 
> > What is the variable which I am able to retrieve?  I am expecting the
> > result to be a 0, 1 or 2.  
> 
> Your original problem was getting a parse error.
> 
> Your query is not php code - step 1 is to fix that.
> 
> Once you've done that, post the new code and new problem you're having.
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux