Probleme with output of function oci_fetch_all

Probleme with output of function oci_fetch_all

am 14.09.2011 18:05:58 von andre.lagadec

--------------000404010406010404070800
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I use PHP with Oracle and I have this code:
$req="select identifiant as \"0\", name as \"1\" from TAB_USER where
identifiant='abcd' and mot_passe='password'";
$conn = oci_connect('foo', 'bar', 'BASE1');
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
$stid = oci_parse($conn, $req);
oci_execute($stid);
$nrows = oci_fetch_all($stid, $tab2);
echo "
$nrows rows fetched
\n";
echo "
tab2[0][0]=".$tab2[0][0];

It works fine in PHP-4.3.10 and give this result
1 rows fetched
tab2[0][0]=abcd

But it doesn't work fine in PHP-5.2.13, because it give this :
1 rows fetched
tab2[0][0]=

If I add this code and run it
echo "
print_r tab2 =
";
print_r($tab2);
var_dump($tab2);

I get in PHP-4.3.10
print_r tab2 =
Array ( [0] => Array ( [0] => abcd ) [1] => Array ( [0] => toto ) )
array(2) { [0]=> array(1) { [0]=> string(4) "abcd" } [1]=> array(1) {
[0]=> string(4) "toto" } }

And in PHP-5.2.13
print_r tab2 =
Array ( [0] => Array ( [0] => abcd ) [1] => Array ( [0] => toto ) )*
array*

'0'=>
*array*
0=> string 'abcd' /(length=4)/
'1'=>
*array*
0=> string 'toto' /(length=4)/

Why there is 'O' in PHP-5.2.13 and not 0 like PHP-4.3.10 ?

Thanks for any help.


--------------000404010406010404070800--