Skip to content

Fix PHP error handling muscling in on database error reports #18450

Closed
@jabcreations

Description

@jabcreations

Description

The following code:

<?php
$result = mysqli_query($db,$query);

if ($result) {}
else {mysqli_error_report($query,mysqli_error($db),__FUNCTION__);}

Resulted in this output:
[Database error] that is now handled by the PHP error handler.

But I expected this output instead:
Database errors should not be handled by PHP error handling!

This changed sometime in the past 1-3 years however I have been too overwhelmed to prioritize pursuing this issue until now.

No, I explicitly do not want to go through my platform and add the mess of ~1,500 instances of try / catch. I have gone through a lot of documentation though there always seems to be something placed in an odd place or not properly worded / missing key words while using Control + F to find relevant information in the documentation.

PHP Version

Local server:
PHP 8.3.6 (cli) (built: Apr 10 2024 14:54:14) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies

Operating System

Both local WAMP and live LAMP servers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions