ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:debug

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:debug [2023/04/08 15:48] – [Description] Remove reference to STDERR dregadv5:userguide:debug [2024/01/09 11:14] – Improve description with text from Logging page before removing it from there dregad
Line 9: Line 9:
 ===== Description ===== ===== Description =====
  
-Enabling debug mode makes the driver return copious amounts of debugging information from both ADOdb and the PHP driver itself. +Enabling debug mode makes the driver return debugging information from both ADOdb and the PHP driver itself. 
 + 
 +The output includes the executed SQL statement with parameters, as well as error messages and backtrace information if there are problems. 
 +It is suitable for viewing in a browser (see [[#formatting|Formatting section below]])  
 + 
 ===== Usage ===== ===== Usage =====
  
Line 20: Line 25:
 include 'adodb.inc.php'; include 'adodb.inc.php';
 $conn = newAdoConnection('mysqli'); $conn = newAdoConnection('mysqli');
 +
 +# Here is the earliest point where Debug Mode can be set
 +
 $conn->connect($host, $user, $pass, 'database'); $conn->connect($host, $user, $pass, 'database');
 +
 +# Enable Debug mode
 $conn->debug = true; $conn->debug = true;
 +
 $recordSet = $conn->execute('SELECT * FROM product'); $recordSet = $conn->execute('SELECT * FROM product');
 </code> </code>
v5/userguide/debug.txt · Last modified: 2024/01/09 11:20 by dregad