ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:error_handling

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
v5:userguide:error_handling [2016/02/01 23:32] – [Error Messages] mnewnhamv5:userguide:error_handling [2016/02/02 03:30] mnewnham
Line 5: Line 5:
  
 ===== PHP set_error_handler ===== ===== PHP set_error_handler =====
-Once the PHP set_error_handler is used to override the default error handling, then the '@' PHP value ceases to be honored, and any SQL statement execution that fails will then produce a fatal error in the statement. We must then implement an error handling layer to trap the error and process it as the required. The first way to do that is by the use of the ''adodb-errorhandler.inc'' file.  +Once the PHP set_error_handler is used to override the default error handling, then the '@' PHP value ceases to be honored, and any SQL statement execution that fails will then produce a fatal error in the statement. We must then implement an error handling layer to trap the error and process it as the required. The first way to do that is by the use of the ''adodb-errorhandler.inc'' file. 
----------------------------------------+ 
 +--------------------------------------------------- 
 <WRAP right box round> <WRAP right box round>
 == See Also == == See Also ==
Line 41: Line 43:
    
 </code> </code>
- +
  
 ===== Override Error Trap/Resume ===== ===== Override Error Trap/Resume =====
Line 73: Line 75:
 $db->raiseErrorFn = $saveErrorFn; $db->raiseErrorFn = $saveErrorFn;
  
 +</code>
 +
 +===== Using A Class Method =====
 +<code php>
 +class c
 +{
 + function e()
 + {
 + print "ERROR TRAP";
 + }
 +}
 +
 +$c = new c;
 +
 +$db->raiseErrorFn = array($c,'e');
 </code> </code>
  
v5/userguide/error_handling.txt · Last modified: 2018/06/27 16:18 by dregad