PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Structures » Structures_DataGrid_DataSource_DBTable » Bug #8125

report Notice if DBTable not use DB package

Details

Submitted2006-07-06 07:20 UTC
Fromkenchou77 at gmail dot com
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid_DataSource_DBTable
PHP Version5.1.4
Roadmaps(Not assigned)

Comments

[2006-07-06 07:20 UTC] kenchou77 at gmail dot com

Description:
------------
if use other DB (like MDB2), script got "Notice: Use of undefined constant DB_FETCHMODE_ASSOC"

Test script:
---------------
$db =& MDB2::factory($DSN);
if (PEAR::isError($db)) {
exit($db->getMessage());
}
$db->setFetchMode(MDB2_FETCHMODE_ASSOC);

$user =& new user($db, DB_TABLE_USER);

$datagrid =& new Structures_DataGrid($count);
$test = $datagrid->bind($user, array('view' =>'list'));
if (PEAR::isError($test)) {
echo $test->getMessage();
}

$datagrid->render(DATAGRID_RENDER_TABLE);

//DBTable.php line 142
//- while ($record = $this->_result->fetchRow(DB_FETCHMODE_ASSOC)) {
//+ while ($record = $this->_result->fetchRow()) {

Expected result:
----------------
//display data list

Actual result:
--------------
Notice: Use of undefined constant DB_FETCHMODE_ASSOC - assumed 'DB_FETCHMODE_ASSOC' in d:\PEAR\Structures\DataGrid\DataSource\DBTable.php on line 142