php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36922 missing Constant
Submitted: 2006-03-30 13:07 UTC Modified: 2006-03-30 13:29 UTC
From: traufeisen@php.net Assigned:
Status: Closed Package: MySQLi related
PHP Version: 5.1.2 OS: CentOS 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: traufeisen@php.net
New email:
PHP Version: OS:

 

 [2006-03-30 13:07 UTC] traufeisen@php.net
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-30 13:29 UTC] tony2001@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 00:01:35 2025 UTC