PHP Function Reference

PHP mysqli debug() Method



The PHP mysqli::debug() / mysqli_debug() function is used to perform debugging operations using the Fred Fish debugging library.

Syntax

//Object-oriented style
public mysqli::debug(options)

//Procedural style
mysqli_debug(options)

Parameters

options

Required. Specify a string representing the debugging operation to perform. The debug control string is a sequence of colon separated fields as follows:

<field_1>:<field_2>:<field_N>

Each field consists of a mandatory flag character followed by an optional , and comma separated list of modifiers:

flag[,modifier,modifier,...,modifier]

The option characters are:

  • O - MYSQLND_DEBUG_FLUSH
  • A/a - MYSQLND_DEBUG_APPEND
  • F - MYSQLND_DEBUG_DUMP_FILE
  • i - MYSQLND_DEBUG_DUMP_PID
  • L - MYSQLND_DEBUG_DUMP_LINE
  • m - MYSQLND_DEBUG_TRACE_MEMORY_CALLS
  • n - MYSQLND_DEBUG_DUMP_LEVEL
  • o - output to file
  • T - MYSQLND_DEBUG_DUMP_TIME
  • t - MYSQLND_DEBUG_DUMP_TRACE
  • x - MYSQLND_DEBUG_PROFILE_CALLS

Return Value

Returns true.

Example: Generating a Trace File

The example below shows the usage of mysqli::debug() method.

<?php
//creating a trace file in '/tmp/client.trace' 
//on the local (client) machine
mysqli_debug("d:t:o,/tmp/client.trace");
?>

❮ PHP MySQLi Reference