[thelist] php array

Mark Groen evolt at markgroen.com
Mon Nov 21 20:39:55 CST 2005

----- Original Message ----- 
From: "Simon Perry" <>
To: <thelist at lists.evolt.org>
Sent: Monday, November 21, 2005 11:35 AM
Subject: Re: [thelist] php array

> Mark Groen wrote:
> >Getting a couple columns from the database with event dates in
> >2005-11-29 format, and would like to display the result with each new
> >month showing the month and day, just for the first event of that
> >and the rest of the days in the month showing just the days.
> >
> >
> >
> A couple of pointers for a starter.
> Use MySQL to get the date in the format you require. [0]
> Retrieve the results as an associative array that way if your database
> schema changes the code won't break plus it also makes it so much
> to maintain.
> $sql='SELECT *, DATE_FORMAT(`event_date`,\'%a %D \') AS day_date,
> DATE_FORMAT(`event_date`,\'%M \') AS month FROM `table_name` ';
> while($row = mysql_fetch_array($eventList,MYSQL_ASSOC)

Thanks Simon, not exactly what I need but it's enough to work off of -
which is exactly what I was looking for the past few days looking for an
example of something like this. Gotta luv this list :-)



More information about the thelist mailing list