php.net |  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
 [2003-10-19 11:11 UTC] dissent at 0--0 dot org
Description:
------------
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";
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-19 11:49 UTC] ali@php.net
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 http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net 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] didou@php.net
This correction is bogus. The example was just fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 17:01:30 2024 UTC