RE: [PEAR-DEV] MDB abstract datatypes
| From: | Lukas Smith | Date: | Fri, 21 Mar 2003 13:55:12 +0000 |
| Subject: | RE: [PEAR-DEV] MDB abstract datatypes | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14535@lists.php.net to get a copy of this message | ||
> From: Jeroen Houben [mailto:jeroen@terena.nl]
> Sent: Friday, March 21, 2003 2:30 PM
> quote from the article:
> /// convert $timeout to the MDB timestamp format
> $timeout = MDB_date::unix2Mdbstamp($timeout);
> // SELECT query showing how the datatype conversion works
> $query = 'SELECT createtime, user_id FROM sessions';
> $query .= ' WHERE session = '.$mdb->getTextValue($session);
> $query .= ' AND lastaccess < '.$mdb->getTimestampValue($timeout);
>
>
> /Could MDB not do this automatically? Especially if you are using the
> MDB schema, it should already know the datatypes of the fields you are
> working with in your query, right? Is that something that is planned
for
> future versions?
The xml schema is only used for schema management and it is not feasible
to change this because it would require a level of knowledge about the
query that you could only get when you parse the SQL query. This of
course would eat way too much performance.
However this would be possible with MDB_DataObjects. But unfortunately
that class does not yet exist (sorta like Alladins wonder lamp in the
recent IBM ads).
Regards,
Lukas