Re: php and mysql
| From: | Tim Burden | Date: | Mon, 31 Mar 2003 23:40:22 +0000 |
| Subject: | Re: php and mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141760@lists.php.net to get a copy of this message | ||
Assuming Month_Start is stored in MySQL date format (yyyy-mm-dd) you could
Select blah blah From blah Order By DATE_FORMAT(Month_Start,%m) ASC
The %m will pad on the zeroes.
http://www.mysql.com/doc/en/Date_and_time_functions.html
----- Original Message -----
From: "Tyler Durdin" <linuxgeek23@hotmail.com>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Monday, March 31, 2003 1:53 PM
Subject: php and mysql
>
> I have a db with events in it. i would like to pull the events out via
php,
> but i would like them to be ordered by month number (1-12). When I do this
> (Select blah blah From blah Order By Month_Start ASC) it orders the months
> by number, but it starts with october (month 10) I am pretty sure it is
> doing this because I have no events until april (month 4). So how can i
get
> it to order the months by their numbers starting with january (1) and
going
> to december (12) even if I do not have events until april (4)?
>
>
>
>
> _________________________________________________________________
> The new MSN 8: advanced junk mail protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>