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 16:35

On Fri, 24 Aug 2007 01:54:24 -0700, Captain Paralytic
<paul_lautman@yahoo.com> wrote:

>On 24 Aug, 03:51, mattm...@hotmail.com wrote:
>
>| what I've tried so far returns errors.
>
>Care to share the errors!

Ok, I uncommentd trace(fe.fault.faultstring) in my actionscript and
the error turned out to be too few parameters to sprintf.

I have this working in a test php file:
$sql = "SELECT DATE_FORMAT(events_date, '%b.' ' %D,' ' %Y') as Date,
events_title as Event, events_description as Description FROM events
ORDER BY Date ASC";

So now I know, yes, I can do what I was looking to do.

My original query in the php class for amfphp is this:
$sql = sprintf("SELECT format_date as Date, events_title as Event,
events_description as Description FROM events ORDER BY Date ASC");

This works fine.

My new query in the php class is this:
$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");

The DATE_FORMAT() is somehow messing with the sprintf so I need to
figure out why and Im good. Off to find my solution!

Thanks
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

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