When a PDO connection is set up with:
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
and passed to the toolkit for use, an error will later arise stating that index 0 was not found: Undefined array key 0
The logic in PdoSupp presumes numeric indexes in looking for index 0. Note that index 0 is the only array element obtained from $result, so we could probably get the first array element in another manner. Either use:
$tmp = current($result); or
$tmp = reset($result);
When a PDO connection is set up with:
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
and passed to the toolkit for use, an error will later arise stating that index 0 was not found:Undefined array key 0
The error occurs on this line: https://github.com/zendtech/IbmiToolkit/blob/85bd8b9ba9c2fd3b3d06544f850a4c74a258bcde/ToolkitApi/PdoSupp.php#L151
The logic in PdoSupp presumes numeric indexes in looking for index 0. Note that index 0 is the only array element obtained from
$result
, so we could probably get the first array element in another manner. Either use:$tmp = current($result);
or$tmp = reset($result);