MDB abstract datatypes
| From: | Jeroen Houben | Date: | Fri, 21 Mar 2003 13:30:26 +0000 |
| Subject: | MDB abstract datatypes | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14534@lists.php.net to get a copy of this message | ||
Hi Lukas,
I just read your article on php-mag.net. Great article btw. I was just wondering about the datatype abstraction.
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?
Regards,
Jeroen