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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC