I ended up using your simpler version, which came out like this:
$contentquery3 = mysql_query("SELECT *, YEAR(date) AS year, YEAR(NOW()) AS now
FROM $articlestable WHERE articleSectionID = '$id' AND YEAR(date) = YEAR(NOW())
ORDER BY date DESC") or mysql_die();
Don Read wrote:
> On 29-Jul-2001 Mike Gifford wrote:
>>I've got a number of press releases that I'd like to be able to order by
>>I'd like everything from this now to a year ago (ie. July 29th, 2000) to be
>>ordered together and then allow folks to scroll back to the previous year
>>30, 2000 to July 29th, 1999, etc.
> Sounds like a confusing interface to me.
> how about selecting by numerical year ?
> if (! isset($wantyear))
> SELECT ... WHERE YEAR(date)='$wantyear' ...
> If you insist on now() - 1 year, look into DATE_SUB(NOW(), INTERVAL 1 YEAR)
Mike Gifford, OpenConcept Consulting, http://openconcept.ca
Offering everything your organization needs for an effective web site.
Abolish Nuclear Weapons Now!: http://pgs.ca/petition/
It is a miracle that curiosity survives formal education. - A Einstein
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]