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
v5:userguide:error_handling [2016/02/02 03:24] mnewnhamv5:userguide:error_handling [2018/06/27 16:18] (current) – function names starting with lowercase (#430) dregad
Line 67: Line 67:
 set_error_handler('ignoreErrorHandler'); set_error_handler('ignoreErrorHandler');
   
-$db->Execute('DROP INDEX index_that_might_not_exist');+$db->execute('DROP INDEX index_that_might_not_exist');
   
 /* /*
Line 75: 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>
  
Line 109: Line 124:
 try  try 
 {    {   
-    $db = NewADOConnection("oci8://scott:bad-password@mytns/");   +    $db = newADOConnection("oci8://scott:bad-password@mytns/");   
  
  
Line 140: Line 155:
  
  
-$c = NewADOConnection('mysql'); +$c = newADOConnection('mysql'); 
-$c->PConnect('localhost','root','','northwind');+$c->pConnect('localhost','root','','northwind');
  
-$rs=$c->Execute('select * from productsz'); ## invalid table productsz+$rs=$c->execute('select * from productsz'); ## invalid table productsz
  
 if ($rs)  if ($rs) 
Line 165: Line 180:
 include('tohtml.inc.php'); include('tohtml.inc.php');
  
-$c = NewADOConnection('mysql'); +$c = newADOConnection('mysql'); 
-$c->PConnect('localhost','root','','northwind');+$c->pConnect('localhost','root','','northwind');
  
-$rs=$c->Execute('select * from productsz'); #invalid table productsz');+$rs=$c->execute('select * from productsz'); #invalid table productsz');
  
 if ($rs)  if ($rs) 
v5/userguide/error_handling.txt · Last modified: 2018/06/27 16:18 by dregad