Re: WHERE clause...getting closer
| From: | Richard Davey | Date: | Wed, 05 May 2004 00:27:35 +0000 |
| Subject: | Re: WHERE clause...getting closer | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185382@lists.php.net to get a copy of this message | ||
Hello msa,
Wednesday, May 5, 2004, 2:18:57 AM, you wrote:
m> $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
m> YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'())
m> . ' ORDER BY
m> sortBy DESC';
m> the above code got a parse error
m> any ideas, anyone?
Your quotes are wrong and you shouldn't use NOW like that:
$query_rsENews = "SELECT * FROM NewsArchive WHERE YEAR(datePublished)
= YEAR(NOW()) AND MONTH(datePublished) = MONTH(NOW()) ORDER BY sortBy
DESC";
Should be a lot closer to what you want.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html