You are here: Re: Want search on timestamp ! Any other alternative ?? « PHP Programming Language « IT news, forums, messages
Re: Want search on timestamp ! Any other alternative ??

Posted by Gordon Burditt on 11/26/07 05:26

>Your method would be ideal. (mktime)
>It is BETTER to store timestamps as INTs rather than DATETIME.
>A simple, X(int) > INT AND X(int) < INT is definitely faster than a
>comparison involving DATETIME fields.

That depends entirely on how you use it. If you have to convert a
timestamp to display it often, you may lose that speed advantage.

Also, many uses for timestamp information can't use a Unix timestamp.
Even my birthdate is too old, so forget using it for genealogy.
And the due date for a new 30-year mortgage is going to go out of range
pretty soon.

>> I have millions of records in my xxxxx table in mysql. And I have a
>> column of time in which I have stored the timestamp using php time()
>> function.
>>
>> Now I wanna write an SQL query to fetch the records either for year
>> (2006) or for month and year (Jan 2006)
>>
>> Currently I had implement this logic:
>> To find records for March 2006
>>
>> start time = mktime( for Feb 2006 )
>> end time = mktime( for April 2006 )
>>
>> I am searching the records greater than start time and lesser than end
>> time.

 

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

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