English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The mysqli_dump_debug_info() function outputs debug information to the log
mysqli_dump_debug_info()The function accepts an object representing the MySQL server connection and dumps debug information to the log.
mysqli_dump_debug_info($con);
Serial Number | Parameters and Description |
---|---|
1 | con(Required) This is an object representing the connection to the MySQL Server. |
This function returns a boolean value, if successful, it will beTRUE; if it fails, it will beFALSE.
This function was originally introduced in PHP version5introduced and can be used in all higher versions.
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
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