WHERE clause...getting closer
| From: | msa | Date: | Wed, 05 May 2004 01:18:57 +0000 |
| Subject: | WHERE clause...getting closer | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185381@lists.php.net to get a copy of this message | ||
$query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'()) .
' ORDER BY
sortBy DESC';
this is supposed to return only the records that have the current month and
year in the datePublished record.
the above code got a parse error
this code:
$query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
YEAR(NOW()) . ' AND MONTH(datePublished) = ' . MONTH(NOW()) . ' ORDER BY
sortBy DESC';
got this error:
Fatal error: Call to undefined function: year()
any ideas, anyone?