v5:userguide:debug
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
v5:userguide:debug [2023/04/08 14:29] – New Formatting section dregad | v5:userguide:debug [2024/01/09 11:20] (current) – [Description] link to Logging page dregad | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== Description ===== | ===== Description ===== | ||
- | Enabling debug mode makes the driver return | + | |
+ | Enabling debug mode makes the driver return debugging information from both ADOdb and the PHP driver itself. | ||
+ | |||
+ | The output | ||
+ | It is suitable for viewing in a browser | ||
+ | |||
+ | See [[v5: | ||
===== Usage ===== | ===== Usage ===== | ||
Line 19: | Line 25: | ||
include ' | include ' | ||
$conn = newAdoConnection(' | $conn = newAdoConnection(' | ||
+ | |||
+ | # Here is the earliest point where Debug Mode can be set | ||
+ | |||
$conn-> | $conn-> | ||
+ | |||
+ | # Enable Debug mode | ||
$conn-> | $conn-> | ||
+ | |||
$recordSet = $conn-> | $recordSet = $conn-> | ||
</ | </ | ||
Line 39: | Line 51: | ||
By default, the parameters passed to the query are compressed into a set of //key => value// pairs. | By default, the parameters passed to the query are compressed into a set of //key => value// pairs. | ||
This information is printed after the SQL statement, using a ''< | This information is printed after the SQL statement, using a ''< | ||
+ | |||
+ | ==== Possible values ==== | ||
+ | |||
+ | In addition to the standard '' | ||
+ | |||
+ | ^ Value ^ Description | ||
+ | | False | Debug mode disabled (normal operations) | ||
+ | | True | Standard mode, prints executed SQL statements and error information including a Backtrace if the query failed. | ||
+ | | -1 | Same as Standard mode, but with the line separators around the SQL statements suppressed. | ||
+ | | 99 | Prints a Backtrace after every query execution, **even if the execution is successful**. | ||
+ | | -99 | Debug information is only printed if query execution failed, reducing the amount of output. | ||
+ | |||
===== Formatting ===== | ===== Formatting ===== | ||
Line 79: | Line 103: | ||
- | ===== Special Options ===== | ||
- | There are 3 non-boolean switches that, if set, will vary some of the output produced | ||
- | |||
- | ^Value^Description^ | ||
- | |99|If set, then the results of a debug_backtrace will be appended to every database execution, **//even if the execution is successful// | ||
- | |-1|If set, and the code is being run in a browser, then the line separators around the statement are suppressed. This option has no effect when the code is run in a CLI environment.| | ||
- | |-99|If set, then the SQL statement print is suppressed **//if the execution succeeds// | ||
===== Limitations ===== | ===== Limitations ===== | ||
v5/userguide/debug.1680956971.txt.gz · Last modified: 2023/04/08 14:29 by dregad