|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43742 mysql_field_name does not return FALSE on error
Submitted: 2008-01-03 21:09 UTC Modified: 2008-01-07 15:02 UTC
From: mo at modejong dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.5 OS: WinXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mo at modejong dot com
New email:
PHP Version: OS:


 [2008-01-03 21:09 UTC] mo at modejong dot com
The mysql_field_name API should return FALSE on errror,
that is what the docs state, but the impl returns NULL.

Here is what the current code returns:

Warning: Wrong parameter count for mysql_field_name() in C:\caucho_dev\trunk\qa\php\ on line 11

Reproduce code:
<php out='stdout'>

mysql_connect("localhost", "", "");
mysql_query("USE test");
$res = mysql_query("SELECT * FROM test WHERE id = 1");

echo 'mysql_field_name($res): ';


Expected result:
Should return FALSE.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-07 15:02 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

When functions receive invalid number of parameters they raise an error 
and return NULL, that's a typically PHP behavior. 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 27 11:03:36 2023 UTC