RE: [PHP-DB] dates and updates recommendation?
| From: | John W. Holmes | Date: | Sun, 26 Jan 2003 16:50:19 +0000 |
| Subject: | RE: [PHP-DB] dates and updates recommendation? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25150@lists.php.net to get a copy of this message | ||
[snip]
> Would I be better off spending a few bytes extra per record and
storing
> things as DATETIME rather than an INT? If I'm looking at the
possibily
> making the application more database-portable in the future, are there
> gotchas I should be aware of with any particular field types?
This has been argued back and forth quite a few times on here. If you
want your application portable, use an INT column, store UNIX
timestamps, and have PHP do all of the conversion/comparisons for you.
If you're just going to be using MySQL, then I definitely recommend
using it's date/time format. MySQL has a wealth of date/time functions
that make it really easy to get exactly what you want out of the table.
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/