[thelist] mySQL DATE_FORMAT question

Tom Dell'Aringa pixelmech at yahoo.com
Tue Jul 29 13:25:53 CDT 2003


--- Simon Willison <cs1spw at bath.ac.uk> wrote:
> Personally I always use MySQL with PHP
> and use PHP's excellent date() function for date formatting; I've
> written up some thoughts on date handling in MySQL here:
> 
> http://simon.incutio.com/archive/2003/07/11/storingDatesInMySQL
> 
> > Also, related question - instead of LIMIT 3, I'd like to get the
> > 3 LATEST articles. I know that the first 3 won't necessarily be
> > that. How can I select the latest 3 by date?
> 
> SELECT
>  ...
> FROM
>  article
> ORDER BY
>  dateCreated DESC
> LIMIT 0, 3
> 
> The DESC is to place them in descending order, then the LIMIT 0, 3
> grabs three starting from the top of the newly ordered result set.

Simon! Good to hear from you. Thanks for the info, both your
suggestions worked great. 

Cheers

Tom

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: Premium Content Author / JavaScript / Every Friday!
http://www.maccaws.com/ :: Group Leader
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward


More information about the thelist mailing list