At 10:31 AM -0400 8/27/99, B.W. McAdams wrote:
>I recently wrote an application (cgi w/ perl) for a client that is for all
>intents and purposes, a modified guestbook. The date of the post is stored as
>a YYYYMMDD timestamp in my mySQL database and parsed out (via substr() )
>go to display it.
>At the present, all the guestbook entries dump on one page.
>However the client has asked me to change it so that the frontend of the
>is a page of by month links..
>The problem here is that the month breakdown is supposed to be year
>(a post from 1997 or a post from 2007 in August should show up on the august
>Since the date is settable through a backend admin script [the "guestbook"
>posts are done by the page owner] and isn't set by the date it was posted, the
>script is completely year insensitive in and of itself.
>I'd like to setup the bymonth breakdown and keep things insensitive - so
>client posts an entry and dates it 10 or 15 years ago, it falls in with the
>1999, 2000, 2001 entries, etc..
>Anyone have any ideas on how to easily approach this with the mySQL query?
>too familiar with mySQL's pattern matching - the solution may lay there if
>someone can point me in the right direction..)
Can't you use:
SELECT ...., MONTH(timestamp_column) as m FROM ... ORDER BY m
or something like that?
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/