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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 23:01:29 2024 UTC