|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25910 Error in example 1 in the mysql_fetch_field doco
Submitted: 2003-10-19 11:11 UTC Modified: 2003-10-19 16:56 UTC
From: dissent at 0--0 dot org Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dissent at 0--0 dot org
New email:
PHP Version: OS:


 [2003-10-19 11:11 UTC] dissent at 0--0 dot org
In the english version of the manual, the documentation for mysql_fetch_field, there's an error in example 1.  The second line in the while loop should use $i, not $result.

The line

       $meta = mysql_fetch_field($result);

Should be:

       $meta = mysql_fetch_field($i);

Expected result:
while ($i < mysql_num_fields($result)) {
       echo "Information for column $i:<br />\n";
       $meta = mysql_fetch_field($i);
       if (!$meta) {
       echo "No information available<br />\n";

Actual result:
while ($i < mysql_num_fields($result)) {
       echo "Information for column $i:<br />\n";
       $meta = mysql_fetch_field($result);
       if (!$meta) {
       echo "No information available<br />\n";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-19 11:49 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

 [2003-10-19 16:56 UTC]
This correction is bogus. The example was just fine.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 19 00:03:32 2021 UTC