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 » MDB2 » Bug #9132

PostgreSQL array datatypes to map PHP arrays

Details

Request #9132PostgreSQL array datatypes to map PHP arrays
Submitted2006-10-22 10:24 UTC
Fromville at mattila dot fi
StatusWont fix
PackageMDB2
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2006-10-22 10:24 UTC] ville at mattila dot fi

Description:
------------
If a column in PostgreSQL is defined as an array, for example varchar[], could it be possible to receive such a data as PHP array from MDB2? Currently MDB2 returns a string presentation of the value {A,B}

Test script:
---------------
$db = MDB2::singleton($dbdsn);
$sql = "SELECT array_field FROM array_table;";
$result = $db->query($sql);
$row = $result->fetchRow(MDB2_FETCHMODE_OBJECT);

$array_value = $row->array_field;

print_r($array_value);
// Useful result could be Array( [0] => A, [1] => B )
// instead of a string {A,B}

Expected result:
----------------
Array( [0] => A, [1] => B )

Actual result:
--------------
string {A,B}