ID: 50701
Updated by: [email protected]
Reported By: gmblar+php at gmail dot com
Status: Open
Bug Type: MySQLi related
Operating System: *
PHP Version: 5.3.1
New Comment:
A fatal error can not be handled in any way, so the user would get an
empty page (as every serious production system has display_errors off,
else it shows confidential info)
Instead you have to check for error which gives you the possibility to
create a nice error page shown to your users.
Previous Comments:
------------------------------------------------------------------------
[2010-01-08 22:40:37] gmblar+php at gmail dot com
Description:
------------
If MySQLi fails it must return a fatal error. A Warning is not enough.
Reproduce code:
---------------
<?php
$database = new MySQLi('127.0.0.1', 'invalid', 'invalid');
?>
Expected result:
----------------
Fatal error: mysqli::mysqli(): (28000/1045): Access denied for user
'invalid'@'localhost' (using password: YES) in /- on line 3
Actual result:
--------------
Warning: mysqli::mysqli(): (28000/1045): Access denied for user
'invalid'@'localhost' (using password: YES) in /- on line 3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50701&edit=1