php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29867 mysqli_result->fetch_array() differs from Documentations
Submitted: 2004-08-27 15:35 UTC Modified: 2004-08-27 16:01 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: faxe at neostrada dot pl Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.0.1 OS: Windows 5.1 32bit
Private report: No CVE-ID: None
 [2004-08-27 15:35 UTC] faxe at neostrada dot pl
Description:
------------
mysqli_result->fetch_array() uses MYSQLI_ASSOC as default argument. Not MYSQLI_BOTH like Documentation claims.

Reproduce code:
---------------
<?php

$foo = $_mysqli->query('SELECT 1 AS bar');
$arr = $foo->fetch_array();

print_r($arr); 
// $arr contains only 'bar' key

?>

Expected result:
----------------
Array
(
    [bar] => 1
)

Actual result:
--------------
Array
(
    [0] => 1
    [bar] => 1
)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-27 15:48 UTC] faxe at neostrada dot pl
Actual & Exptected fields switched their values in this Bugreport
 [2004-08-27 16:01 UTC] georg@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

This is already fixed in CVS. See bug #29335 
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 16 04:00:01 2025 UTC