mysqli::debug

mysqli_debug

(PHP 5, PHP 7)

mysqli::debug -- mysqli_debugPerforms debugging operations

说明

面向对象风格

bool mysqli::debug ( string $message )

过程化风格

bool mysqli_debug ( string $message )

Performs debugging operations using the Fred Fish debugging library.

参数

message

A string representing the debugging operation to perform

返回值

Returns TRUE.

注释

Note:

To use the mysqli_debug() function you must compile the MySQL client library to support debugging.

范例

Example #1 Generating a Trace File

<?php

/* Create a trace file in '/tmp/client.trace' on the local (client) machine: */
mysqli_debug("d:t:o,/tmp/client.trace");

?>

参见

User Contributed Notes

Peter 10-May-2014 07:59
can there be more documenation with a small (but working) example script on how to use this ?

Some issues  (Ive seen the "same" code example in dozens of tutorials):-

( I'll use capitals for emphasis only)

QUESTION: what does D:T:O mean ? UNEXPLAINED.

QUESTION: Do we *ONLY* use these 3 lines in a self-contained script ? Does this log ALL future MYSQL commands ?

QUESTION :- Do we put that one line just

- immediately after we connect to MYSQL ?
- before we connect to MYSQL ?
- before our suspected error ?