You are here: Re: Data format in application or database? « PHP Programming Language « IT news, forums, messages
Re: Data format in application or database?

Posted by Jeff North on 09/09/06 14:40

On Sat, 09 Sep 2006 09:40:03 +0100, in comp.lang.php turnitup
<same@same>
<45027de4$0$1377$da0feed9@news.zen.co.uk> wrote:

>| I have found that by far the easiest way to store dates in my LAMP
>| application is in a text string in the database in Unixtime format.
>|
>| First of all, what would be the most efficient data type to store this as?

Numeric format.

>| Secondly, in terms of translating into a human readable format, is it
>| quicker to format the date in the application using date() or in the
>| database in the select query?
>|
>| Any thoughts?

Its much the much either the database server or the web server needs
to do the processing. You'll need to decide which one can carry the
load.

I prefer the database to handle such things as dates and times. They
have their own native (interal) formats for storing the data and thus
more efficient at retrieval and processing.

By storing the time as text you loose the ability to:
1. do any date/time calculations
2. restrict or delete records between date/time ranges
3. do date/time comparisons.
---------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------

 

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

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