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 » Database » DB » Bug #616

Warning: Undefined index: autofree in DB.php (when doing a query)

Details

Submitted2004-01-24 10:43 UTC
Frompear-01 at oliverklee dot de
Assigneddanielc
StatusBogus
PackageDB
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2004-01-24 10:43 UTC] pear-01 at oliverklee dot de

Description:
------------
(Using PHP 4.2.2 and mySQL 3.23 that came with RedHat 9 and PEAR-DB 1.5.0rc2.)

When doing a simple SELECT * query with error_reporting(E_ALL), I get the following warning:

Notice: Undefined index: autofree in /home/klee/public_html/i2brain/version-02/include/pear/DB.php on line 697

Line 697 is the following line in the function DB_result:

$this->autofree = $dbh->options['autofree'];

Reproduce code:
---------------
$dsn = "mysql://$DB_USER:$DB_PASS@localhost/$DB_NAME";
$db = DB :: connect($dsn);

$queryResult = $db -> query('SELECT * FROM visitors');
$entries = $queryResult -> numRows();
echo 'Number of entries: '.$entries."\n";

$db -> disconnect();

Expected result:
----------------
Number of entries: 44

Actual result:
--------------
Notice: Undefined index: autofree in /home/klee/public_html/i2brain/version-02/include/pear/DB.php on line 697
Number of entries: 44