Tuesday, May 06, 2014

Error Rporting in php

Error Control Operators @

PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.
For example:
$x=@mysqli_query($con, $abc);

error_reporting (PHP 4, PHP 5)

error_reportingSets which PHP errors are reported
int error_reporting ([ int $level ] )
The error_reporting() function sets the error_reporting directive at runtime. PHP has manylevels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level.

Don't show the warning as well as error user

// Turn off all error reporting
error_reporting(0);