You are here: Re: Format datetime with query? « PHP SQL « IT news, forums, messages
Re: Format datetime with query?

Posted by MattMika on 08/24/07 17:10

On Fri, 24 Aug 2007 18:46:55 +0200, Rik <luiheidsgoeroe@hotmail.com>
wrote:

>Huh?
>'%b. %D, %Y' seems OK to me, why bother breaking it apart (which would
>result in an error in mysql).
>
>> Date, events_title as Event, events_description as Description FROM
>> events ORDER BY Date ASC");
>>
>> The DATE_FORMAT() is somehow messing with the sprintf so I need to
>> figure out why and Im good. Off to find my solution!
>
>Use %% for every % in the date format string.
>
>$sql = sprintf("SELECT DATE_FORMAT(events_date, '%%b. %%D, %%Y') as Date,
>events_title as Event, events_description as Description FROM events ORDER
>BY Date ASC");
>
>Then again, if this is your real statement, why even bother with the
>sprintf()? Only usefull for inserting/updating/searching on 'unknown'
>variables.

I am taking the sprintf out, I was not paying very good attn. Since Im
not sending variables from Flash to the query it is not needed. Thanks
for your help.
Matt Mika

 

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

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