gpt4 book ai didi

php - 您可以从 mysqli 对象获取连接数据吗?

转载 作者:行者123 更新时间:2023-11-29 00:04:28 25 4
gpt4 key购买 nike

当您在 php 中创建一个 mysqli 对象时,您向它提供数据以便它可以连接。一个例子:

$mysqli = new mysqli($address, $user, $pass, $database);

是否可以从生成的对象中取回您提供给它的数据?

最佳答案

没有。

数据在用于开始连接后根本不存在。这是 print_r 的输出:

mysqli Object
(
[affected_rows] => 0
[client_info] => mysqlnd 5.0.11-dev - 20120503 - $Id: [not sure if this was sensitive information, so redacted. was just a long string of numbers] $
[client_version] => 50011
[connect_errno] => 0
[connect_error] =>
[errno] => 0
[error] =>
[error_list] => Array
(
)

[field_count] => 0
[host_info] => localhost via TCP/IP
[info] =>
[insert_id] => 0
[server_info] => 5.5.36
[server_version] => 50536
[stat] => Uptime: 294546 Threads: 1 Questions: 351 Slow queries: 0 Opens: 53 Flush tables: 1 Open tables: 0 Queries per second avg: 0.001
[sqlstate] => 00000
[protocol_version] => 10
[thread_id] => 99
[warning_count] => 0
)

关于php - 您可以从 mysqli 对象获取连接数据吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28188307/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com