ID: 36922 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: MySQLi related Operating System: CentOS 4 PHP Version: 5.1.2 New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-03-30 13:07:32] [EMAIL PROTECTED] Description: ------------ Mysqli provides the possibility to throw an exception if an error occurs. This can be done with "mysqli_report(3)" 1 = MYSQLI_REPORT_ERROR 2 = MYSQLI_REPORT_STRICT However, the MYSQLI_REPORT_STRICT constant doesn´t exists in PHP-userland (defined in php_mysqli.h). A small patch which is adding this constant is available at http://www.phpschlampe.de/mysqli.patch Reproduce code: --------------- <?php error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $sql = new mysqli("localhost","root","wrongpass","test"); ?> Expected result: ---------------- PHP Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Access denied for user 'root'@'localhost' .... Actual result: -------------- PHP Notice: Use of undefined constant MYSQLI_REPORT_STRICT - assumed 'MYSQLI_REPORT_STRICT' in /home/traufeisen/mysqlitest.php on line 4 PHP Warning: mysqli::mysqli(): (28000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /home/traufeisen/mysqlitest.php on line 5 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36922&edit=1