Re: [PHP] WHERE clause...getting closer

2004-05-05 Thread Tom
Ray Hunter wrote: On Tue, 2004-05-04 at 19:18, msa wrote: $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

Re: [PHP] WHERE clause...getting closer

2004-05-05 Thread msa
Curt, thanks, your code works perfectly. Can I ask you two questions? 1. I am not sure what you mean by adding an index. I looked in the mySQL help files and from what I can figure, I have already done that... 2. Now that the code actually works, we have come up with an issue. When the

[PHP] WHERE clause...getting closer

2004-05-04 Thread msa
$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

Re: [PHP] WHERE clause...getting closer

2004-05-04 Thread Richard Davey
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'()) . ' ORDER BY m sortBy DESC'; m the above code got a parse error m any ideas, anyone? Your

Re: [PHP] WHERE clause...getting closer

2004-05-04 Thread Curt Zirzow
* Thus wrote msa ([EMAIL PROTECTED]): $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?

Re: [PHP] WHERE clause...getting closer

2004-05-04 Thread Ray Hunter
On Tue, 2004-05-04 at 19:18, msa wrote: $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