php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10825 mysql_field_name() won't return element 0
Submitted: 2001-05-12 05:13 UTC Modified: 2001-05-14 22:42 UTC
From: norny at geocities dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.5 OS: Win98 and Linux 2.4.4
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: norny at geocities dot com
New email:
PHP Version: OS:

 

 [2001-05-12 05:13 UTC] norny at geocities dot com
I can't get mysql_field_name() to return the field name of
position 0 in the mysql result from my query. All subsiquent
field names appear, just not the first one. I even tried
just forcing a 0 in the position instead of the incremented
variable:

$result = mysql_query ( $sql );
while($db_content = mysql_fetch_row($result)) {
  for($i=0; $i < sizeof($db_content); $i++) {
    echo mysql_field_name($result, 0);
  }
}

That code doesn't output anything whereas if I replace the 0
in mysql_field_name() with $i, it prints the field names of
all but my first column.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-14 22:42 UTC] norny at geocities dot com
Nevermind. It was my script, not PHP itself.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 05 20:01:29 2025 UTC