View Single Post
Old 05-07-2008, 07:27 PM   #13 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Quote:
As a sidenote, mysqli_report() doesn't suppress the PHP notice itself, it just means mysqli_connect_error() doesn't get any information to return to you.
actually when that is active, errors that the object encounters get passed through an exception called 'mysqli_sql_exception' therefore doesnt go through the normal PHP error reporting; resulting in both '@' and 'error_reporting(0)' failing to catch its messages.

Also as an example, the code snippet posted by salathe, when run with mysqli_report(MYSQLI_REPORT_OFF) set, the message generated is:

Code:
Doh MySQLi Exception: Access denied for user 'root'@'localhost' (using password: YES)
which is the exception message set in the catch statement however if its set to on (MYSQLI_REPORT_ALL):

Code:
Access denied for user 'root'@'localhost' (using password: YES)
so you see, with it ON the 'mysqli_sql_exception' overrides the exception being thrown in the class because it is raised inside the mysqli object itself.

Glad your all sorted though.
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote