#43742 [Opn->Bgs]: mysql_field_name does not return FALSE on error
| From: | iliaa@php.net | Date: | Mon, 07 Jan 2008 15:02:31 +0000 |
| Subject: | #43742 [Opn->Bgs]: mysql_field_name does not return FALSE on error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121106@lists.php.net to get a copy of this message | ||
ID: 43742
Updated by: iliaa@php.net
Reported By: mo at modejong dot com
-Status: Open
+Status: Bogus
-Bug Type: MSSQL related
+Bug Type: MySQL related
Operating System: WinXP
PHP Version: 5.2.5
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
When functions receive invalid number of parameters they raise an error
and return NULL, that's a typically PHP behavior.
Previous Comments:
------------------------------------------------------------------------
[2008-01-03 21:09:35] mo at modejong dot com
Description:
------------
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:
mysql_field_name($res):
Warning: Wrong parameter count for mysql_field_name() in
C:\caucho_dev\trunk\qa\php\f.qa on line 11
NULL
Reproduce code:
---------------
<php out='stdout'>
<?php
mysql_connect("localhost", "", "");
mysql_query("USE test");
$res = mysql_query("SELECT * FROM test WHERE id = 1");
echo 'mysql_field_name($res): ';
var_dump(mysql_field_name($res));
?>
</php>
Expected result:
----------------
Should return FALSE.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43742&edit=1