WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : error_reporting -- set which PHP errors are reported
Categories : PHP, PHP Functions, Errors and Logging Update Picture
documentation group PHP
Date : Apr 24th 1999
Grade : Be the 1st to grade this Code Example
Viewed : 3860
File : No file for this code example.
Images : No Images for this code example.
Search : More code by documentation group PHP
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

Description

Description

</H2
><DIV
CLASS="funcsynopsis"
><A
NAME="AEN11687"
></A
><P
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>int <B
CLASS="function"
>error_reporting</B
></CODE
> ([int
level])</CODE
></P
><P
></P
></DIV
><P
>&#13; Sets PHP's error reporting level and returns the old level. The
error reporting level is either a bitmask, or named constant. Using
named constants is strongly encouraged to ensure compatibility for
future versions. As error levels are added, the range of integers
increases, so older integer-based error levels will not always
behave as expected.
<TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN11695"
></A
><P
><B
>Example 1. Error Integer changes</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13;error_reporting (55); // PHP 3 equivalent to E_ALL ^ E_NOTICE

/* ...in PHP 4, '55' would mean (E_ERROR | E_WARNING | E_PARSE |
E_CORE_ERROR | E_CORE_WARNING) */

error_reporting (2039); // PHP 4 equivalent to E_ALL ^ E_NOTICE

error_reporting (E_ALL ^ E_NOTICE); // The same in both PHP 3 and 4
</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
Follow the links for the internal values to get their meanings:
<DIV
CLASS="table"
><A
NAME="AEN11698"
></A
><P
><B
>Table 1. <B
CLASS="function"
>error_reporting()</B
> bit values</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>constant</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>value</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-error"
>E_ERROR</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-warning"
>E_WARNING</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>4</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-parse"
>E_PARSE</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>8</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-notice"
>E_NOTICE</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>16</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-core-error"
>E_CORE_ERROR</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>32</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-core-warning"
>E_CORE_WARNING</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>64</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-compile-error"
>E_COMPILE_ERROR</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>128</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-compile-warning"
>E_COMPILE_WARNING</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>256</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-user-error"
>E_USER_ERROR</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>512</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-user-warning"
>E_USER_WARNING</A
>
         </TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>1024</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>&#13;         <A
HREF=devel-errors#internal.e-user-error"
>E_USER_NOTICE</A
>
         </TD
></TR
></TBODY
></TABLE
></DIV
>
</P
><P
>&#13; <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN11752"
></A
><P
><B
>Example 2. <B
CLASS="function"
>error_reporting()</B
> examples</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="programlisting"
>&#13;error_reporting(0);
/* Turn off all reporting */

error_reporting (7); // Old syntax, PHP 2/3
error_reporting (E_ERROR | E_WARNING | E_PARSE); // New syntax for PHP 3/4
/* Good to use for simple running errors */

error_reporting (15); // Old syntax, PHP 2/3
error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // New syntax for PHP 3/4
/* good for code authoring to report uninitialized or (possibly mis-spelled) variables */

error_reporting (63); // Old syntax, PHP 2/3
error_reporting (E_ALL); // New syntax for PHP 3/4
/* report all PHP errors */
</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
</P
></DIV
>




DB Connection Function with error handling and email failure notices
Categories : PHP, MySQL, Errors and Logging, Databases, Errors and Logging
A simple function to prevent undefined $_POST/$_GET/$_SESSION variable errors
Categories : PHP, Variables, Errors and Logging
Logging 404 errors in your custom statistics using Apache and a PHP script.
Categories : Apache, Web Servers, PHP, Errors and Logging
Visits-tracking
Categories : PHP, Databases, MySQL, Errors and Logging, Functions
Error mailing logging facility
Categories : PHP, Errors and Logging, Email
Ping a Server and run a command to fix it if it is down
Categories : PHP, Errors and Logging, Regexps
A Custom Error Handling And Debugging Class
Categories : PHP, PHP Classes, Debugging, Errors and Logging
Building a basic error handler with custom error types
Categories : PHP, PHP Classes, Errors and Logging
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Example of function to send out email if error occurs
Categories : PHP, Email, Debugging, Errors and Logging
[PHP5] PHP Debugger and Helper
Categories : PHP, PHP Classes, Errors and Logging, Debugging, XML
error_log -- send an error message somewhere
Categories : PHP, PHP Functions, Errors and Logging
Intelligent 404 Handler
Categories : PHP, Errors and Logging
Retrieve text from table and email to your e- address in pipe delimited format.
Categories : PHP, MySQL
Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs.
Categories : Databases, PHP, MySQL, Complete Programs