English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP mysqli_dump_debug_info() Function Usage and Example

PHP MySQLi Reference Manual

The mysqli_dump_debug_info() function outputs debug information to the log

Definition and Usage

mysqli_dump_debug_info()The function accepts an object representing the MySQL server connection and dumps debug information to the log.

Syntax

mysqli_dump_debug_info($con);

Parameter

Serial NumberParameters and Description
1

con(Required)

This is an object representing the connection to the MySQL Server.

Return Value

This function returns a boolean value, if successful, it will beTRUE; if it fails, it will beFALSE.

PHP version

This function was originally introduced in PHP version5introduced and can be used in all higher versions.

Online Example

The following example demonstratesmysqli_dump_debug_info()Usage of Functions (Procedural Style)-

<?php
   //Establish Connection
   $con = mysqli_connect("localhost", "root", "password", "mydb");
   $res = mysqli_dump_debug_info($con);
   if($res){
      print("Debug Successful");
   }else{
      print("Debug Failed");
   }
?>

Output Result

Debug Successful

Online Example

Dump debug information to the log:

<?php
   $servername = "localhost";
   $username = "root";
   $password = "password";
   $dbname = "mydb";
   $conn = new mysqli($servername, $username, $password, $dbname);
   if($conn-if(connect_error) {
      die('Connect Error ('. mysqli_connect_errno() . ') '. mysqli_connect_error());
   } 
   echo 'Success... ' . mysqli_get_host_info($conn) . '\n';
   mysqli_dump_debug_info($conn);
   mysqli_autocommit($conn,FALSE);
   mysqli_query($conn,"INSERT INTO w3codebox_auto (id,name) VALUES (10sai());
   mysqli_commit($conn);
   
   mysqli_close($conn);
?>

Output Result

Success... localhost via TCP/IP

PHP MySQLi Reference Manual