note 130271 added to function.set-exception-handler

From: Date: Mon, 28 Apr 2025 20:17:01 +0000
Subject: note 130271 added to function.set-exception-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-222114@lists.php.net to get a copy of this message
For those who are frustrated that PHP is now handling your SQL errors it's actually buried here: https://www.php.net/mysqli_report Specifically: https://www.php.net/manual/en/mysqli.constants.php#constant.mysqli-report-off Which is ironic. Yes, there is some validity to trying to centralize all error reporting regardless of the source of the errors but if you're like me with ~1,500 instances of SQL queries it's not at the top of your to-do list (especially with how much technical debt many people have on top of client demands). Simply add this along with your other error reporting settings: <?php //Prevents PHP from handling SQL errors: mysqli_report(MYSQLI_REPORT_OFF); ?> If you're starting a new project or have way too much time on your hands then I'd agree you're in a better position to try to merge all of the error reporting. Choose wisely and good luck! ---- Server IP: 45.112.84.4 Probable Submitter: 45.112.84.18 (proxied: 193.37.254.186) ---- Manual Page -- https://php.net/manual/en/function.set-exception-handler.php Edit -- https://main.php.net/note/edit/130271 Del: integrated -- https://main.php.net/note/delete/130271/integrated Del: useless -- https://main.php.net/note/delete/130271/useless Del: bad code -- https://main.php.net/note/delete/130271/bad+code Del: spam -- https://main.php.net/note/delete/130271/spam Del: non-english -- https://main.php.net/note/delete/130271/non-english Del: in docs -- https://main.php.net/note/delete/130271/in+docs Del: other reasons-- https://main.php.net/note/delete/130271 Reject -- https://main.php.net/note/reject/130271 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#222114) next »