Home » Database » MDB2 » Bug #9132
PostgreSQL array datatypes to map PHP arrays
Details
| Request #9132 | PostgreSQL array datatypes to map PHP arrays |
|---|---|
| Submitted | 2006-10-22 10:24 UTC |
| From | ville at mattila dot fi |
| Status | Wont fix |
| Package | MDB2 |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| 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}