Re: Migrating from PEAR::DB to PEAR::MDB2

From: Date: Fri, 30 Nov 2007 14:50:41 +0000
Subject: Re: Migrating from PEAR::DB to PEAR::MDB2
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-28246@lists.php.net to get a copy of this message
Hi Gerry, Gerry Demaret wrote:
Hello list, I'm currently working on a project that is still using the PEAR::DB classes, and I was looking into migrating it to PEAR::MDB2. However, I have encountered a problem. It makes extensive use of the following feature of PEAR::DB: $id = $db->getOne('SELECT id FROM language WHERE name_short=?', array($name)); The array with values to replace in the query. I have been looking at MDB2, but it doesn't seem to support it? I found this feature one of the best in PEAR::DB. Am I looking in the wrong places? Does MDB2 support this feature at all?
To use get* methods in MDB2 you must use the extended-module. like this: $db->loadModule('Extended'); for all get* methods you do this: $db->extended->get*(); Also see: http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Extended.html Robert

« previous php.pear.general (#28246) next »