PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #4760

DB_DataObject_Cast fails on blob insert.

Details

Submitted2005-07-06 19:32 UTC
Fromeinurech at bluewin dot ch
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP VersionIrrelevant
OSWindows XP
Roadmaps(Not assigned)

Comments

[2005-07-06 19:32 UTC] einurech at bluewin dot ch

Description:
------------
version 1.7.14

Trying an $object->insert() which has a DB_DataObject_Cast::blob($s) property fails, error message:

Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in D:\svn\dfc\gym\trunk\pear\DB\DataObject\Cast.php on line 392

The code worked well in the last release 1.7.13.

Reproduce code:
---------------
I found the error being caused by an empty $DB object (caused by a typo?) in

function toStringFromBlob() and
function toStringFromString()

Lines 388, 392, 432, 436 should use
$db->connection instead of
$DB->connection