라이브러리

[PHP] mysqli::dump_debug_info - 디버깅 정보를 로그에 덤프합니다.




PHP에서 mysqli::dump_debug_info


mysqli::dump_debug_info는 MySQLi 객체의 메소드 중 하나로, MySQLi 객체의 현재 상태를 문자열로 반환합니다. 이 메소드는 디버깅이나 테스트 목적으로 사용할 수 있습니다.

# 사용법


#hostingforum.kr
php

mysqli::dump_debug_info()



# 반환값


이 메소드는 MySQLi 객체의 현재 상태를 문자열로 반환합니다. 반환된 문자열은 MySQLi 객체의 속성, 설정, 그리고 현재 연결 상태를 포함합니다.

# 예제


#hostingforum.kr
php

<?php

// MySQLi 객체를 생성합니다.

$conn = new mysqli("localhost", "username", "password", "database");



// MySQLi 객체의 현재 상태를 문자열로 반환합니다.

$debug_info = $conn->dump_debug_info();



// 반환된 문자열을 출력합니다.

echo $debug_info;

?>



# 예제 결과


이 예제를 실행하면 MySQLi 객체의 현재 상태를 문자열로 반환하는 메소드의 결과가 출력됩니다. 결과는 다음과 같습니다.

#hostingforum.kr


mysqli_report(message_print_function: user_error...)

Client information:

    client version: mysqlnd 7.4.0 Driver for MySQL, version 5.7.33

    protocol version: 10

    connection: Localhost via UNIX socket

Server information:

    Server type: MySQL

    Server name: localhost

    Server SQL version: 5.7.33

    Server OS: Linux

    Client information for connection to hostname: localhost

    Client user: username

    Client host: (unknown)

    Client port: 0

    Local time zone: UTC

    Default character set: utf8mb4

    Statistics:

        Uptime: 0 sec

        Threads: 1

        Questions: 0

        Slow queries: 0

        Opens: 0

        Flush tables: 0

        Query cache hits: 0

        Query cache misses: 0

        Queries per second avg: 0



이 예제는 MySQLi 객체의 현재 상태를 문자열로 반환하는 메소드의 사용법과 결과를 보여줍니다. 이 메소드는 디버깅이나 테스트 목적으로 사용할 수 있습니다.

참고


* [mysqli::dump_debug_info](https://www.php.net/manual/ko/mysqli.dump-debug-info.php) - PHP 공식 문서
* [MySQLi](https://www.php.net/manual/ko/book.mysqli.php) - PHP 공식 문서
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 381 페이지

검색

게시물 검색