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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
12 + 14 = ?
Subscribe to this entry?

 
 [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: Thu May 02 22:01:30 2024 UTC