PEAR is archived and read-only

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

Home » Database » DB » Bug #3512

if getCol receives $params, but no $col, an error is returned

Details

Submitted2005-02-17 21:24 UTC
Frompatrick dot lambert at noggin dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version4.3.10
OSSolaris
Roadmaps(Not assigned)

Comments

[2005-02-17 21:24 UTC] patrick dot lambert at noggin dot com

Description:
------------
When using Oracle, if getCol is passed a $params array, but not a $col value, then an ORA-00911 error is returned. The documentation states that both arguments are optional.

Reproduce code:
---------------
You have a table named bar, with columns named foo and baz. You have a connected DB object named $db...

$sql = 'select foo from bar where baz = ?';
$sql_params = array('blah');

$column_data1 =& $db->getCol($sql, $sql_params);
$column_data2 =& $db->getCol($sql, 0, $sql_params);

print_r($column_data1);
print_r($column_data2);

Expected result:
----------------
$column_data1 and $column_data2 should be the same.

Actual result:
--------------
$column_data1 is an error object (getDebugInfo shows nativecode=ORA-00911: invalid character), while $column_data2 correctly returns an array of values.

[2005-02-17 21:52 UTC] patrick dot lambert at noggin dot com

so true. i need to get more sleep.