You are here: Re: Sort after adding leading zero to date? « PHP Programming Language « IT news, forums, messages
Re: Sort after adding leading zero to date?

Posted by GarryJones on 12/11/06 15:59

I tried that but its not working, I got Parse error: syntax error,
unexpected T_LNUMBER in
/customers/scfmotion.se/scfmotion.se/httpd.www/scfml_lst.php on line 6

I think this is because

> SELECT
> *, DATE(CONCAT('2007', ml_mna, '-', ml_dya)) AS thedate
> FROM
> ml_lopp
> LEFT JOIN
> scfmforening
> ON
> (scfmforening.scfmnum = ml_lopp.scfmnum)
> LEFT JOIN
> ml_tidplats
> ON
> (ml_tidplats.loppnum = ml_lopp.loppnum)
> ORDER BY
> thedate
>
> This idea is to concatenate 2007, the month, and the day, then you get
> 2007-2-1 for the 1st of january, and the function :
> DATE() receives it [ DATE('2007-2-1') ] and return :
> 2007-02-01
> And this value is put in "thedate", which is used for the sorting ;)

ml_mna and ml_dya are in the table ml_tidplats and that info is
extracted with the left join function. So how can I refer to the fields
ml_mna and ml_dya ?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация