Re: Adoption of Metabase

From: Date: Sun, 18 Nov 2001 21:50:44 +0000
Subject: Re: Adoption of Metabase
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-2980@lists.php.net to get a copy of this message
At 07:54 PM 11/17/01 -0200, Manuel Lemos wrote:
- Metabase API already provides true portability to database applications, so you would not need to crack your head doing what Metabase already does.
Firstly, I can certainly see benefits in using Metabase - to take an example: in a new script I am writing I need to store a lot of dates in a database - Metabase would make it much easier to be cross-database compatible. I believe date handling hasn't been implemented in PEAR-DB yet?
IMHO the most portable way of storing dates is to just store them as timestamp in an int field. - php already uses timestamps for storing dates. - If you use timestamps in the DB it takes less storage space (at least for MySQL). possible mysql specific: - If you want to display the date witout extra coding in MySQL you can use the FROM_UNIXTIME() function - If you have a date but want a timestamp in MySQL you can use UNIX_TIMESTAMP() more info on those two functions in MySQL is available here: http://www.mysql.com/doc/D/a/Date_and_time_functions.html

« previous php.pear.dev (#2980) next »