Bug #8915 [NEW]: Fetching vom Database does not work with Oracle
| From: | d dot schwarz at lise dot de | Date: | Mon, 09 Oct 2006 09:09:21 +0000 |
| Subject: | Bug #8915 [NEW]: Fetching vom Database does not work with Oracle | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-8580@lists.php.net to get a copy of this message | ||
From: d dot schwarz at lise dot de
Operating system: Windows
Package version:
PHP version: 5.0.4
Package: Documentation
Bug Type: Bug
Bug description: Fetching vom Database does not work with Oracle
Description:
------------
Since Oracle uses uppercase column-namens i had to change some Indeses
from ['id'] to ['ID'] in the container classes to work.
Strange, but this little change helped in my situation
Test script:
---------------
// example for changed fetchLangs function in db.php-Container
// }}}
// {{{ fetchLangs()
/**
* Fetch the available langs if they're not cached yet.
*/
function fetchLangs()
{
$query = sprintf('SELECT %s AS id, %s AS name, %s AS meta, %s AS
error_text, %s AS encoding FROM %s',
$this->db->quoteIdentifier($this->options['lang_id_col']),
$this->db->quoteIdentifier($this->options['lang_name_col']),
$this->db->quoteIdentifier($this->options['lang_meta_col']),
$this->db->quoteIdentifier($this->options['lang_errmsg_col']),
$this->db->quoteIdentifier($this->options['lang_encoding_col']),
$this->db->quoteIdentifier($this->options['langs_avail_table'])
);
++$this->_queries;
$res = $this->db->getAll($query, DB_FETCHMODE_ASSOC);
if (PEAR::isError($res)) {
return $res;
}
foreach ($res as $row) {
$this->langs[$row['ID']] = $row;
}
}
Expected result:
----------------
it works :-)
otherwise i allways get "object #resourceId"
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=8915&edit=1
--