[Cartoweb-users] fetchAll in querying DB

Fabio D'Ovidio fabiodovidio at gmail.com
Thu Mar 27 11:27:16 EDT 2008


Hi. Consider this:
        
         $dsn = $this->getConfig()->dbSecurityDsn;
         $db = Utils::getDb($db, $dsn);
         $sql = "select myval from db";
         $res = $db->query($sql);
         Utils::checkDbError($res);
         $row =& $res->fetchRow(DB_FETCHMODE_OBJECT);
         $value = $row->myval ;


Now, if query result is >1 how can I do to fetch all results?

I try with "fetchAll", but the error is:
*Fatal error*: Call to undefined method DB_result::fetchAll(), but I see:
http://pear.php.net/reference/MDB-0.9.2/apidoc/MDB-0.9.2/MDB_common.html#methodfetchAll

..and how can i do to close DB connection with PEAR?

Thanks

-- 
Ing. Fabio D'Ovidio

INOVA Open Solutions s.r.l.
Web : http://www.inovaos.it
Tel.: 081 197 57 600
mail: fabiodovidio at gmail.com



More information about the Cartoweb-users mailing list