ID: 47064
Updated by: [email protected]
Reported By: greg dot hendrickson at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: MySQLi related
Operating System: Windows XP SP3
PHP Version: 5.2.8
New Comment:
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same.
Thank you for your interest in PHP.
see bug #45940
Previous Comments:
------------------------------------------------------------------------
[2009-01-10 21:13:04] greg dot hendrickson at yahoo dot com
Description:
------------
Object oriented style mysqli->connect_error string always null even
when a connection error occurs. Tried with bogus host name, bogus user
name, bogus password, and bogus schemata...result always the same
(mysqli->connect_error is NULL). Note: Procedural style always returns
expected string value.
Installed PHP with Windows Installer, Apache 2.2 Module and the
following extensions: BZ2, MCRYPT, MHASH, MYSQLI, PDO, TIDY, XMLRPC, XSL
and ZIP.
Reproduce code:
---------------
<?php
$mysqli = new mysqli("bogushost", "username", "password", "schemata");
$connecterror = "Object oriented style mysqli->connect_error string:
".$mysqli->connect_error."</br>";
echo $connecterror;
printf("Proceedural style mysqli_connect_error string: %s\n",
mysqli_connect_error()."</br>");
/* check connection never works*/
if ($mysqli->connect_error()) {
printf("Connect failed: %s\n", mysqli_connect_error()."</br>");
exit();
}
/* close connection */
$mysqli->close();
?>
Expected result:
----------------
Object oriented style mysqli->connect_error string: Unknown MySQL
server host 'bogus' (11001)
Proceedural style mysqli_connect_error string: Unknown MySQL server
host 'bogus' (11001)
Connect failed: Unknown MySQL server host 'bogus' (11001)
Actual result:
--------------
Object oriented style mysqli->connect_error string:
Proceedural style mysqli_connect_error string: Unknown MySQL server
host 'bogus' (11001)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47064&edit=1