RE: [PEAR] MDB::convertResult()
| From: | Lukas Smith | Date: | Wed, 22 Oct 2003 19:48:18 +0000 |
| Subject: | RE: [PEAR] MDB::convertResult() | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8546@lists.php.net to get a copy of this message | ||
> From: Paul M Jones [mailto:pmjones@ciaweb.net]
> Sent: Wednesday, October 22, 2003 9:45 PM
> I'm starting to work with MDB 1.1.4 and doing OK, but I have one
> question about converting results. I know that one can use
> MDB::convertResult() to convert, say, a database-returned date value to
> the MDB-standard representation for dates. But...
>
> How does one convert an MDB-standard representation back to the
> database-specific one? Or does MDB handle that for you?
You will need to use the getValue() method to manually convert the result.
BTW: convertResult() is automatically called if you set the types
beforehand. You can either use setResultTypes() method or simply pass them
as an array along with any of the methods that let you execute a query. It
should always be the second parameter there.
Please also take a look at my article on MDB on the php mag site:
http://www.php-mag.net/itr/online_artikel/show.php3?id=283&nodeid=114
Regards,
Lukas