你能从mysqli对象获取连接数据吗?

时间:2015-01-28 09:08:32

标签: php mysql mysqli

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

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

是否可以从结果对象中获取您提供的数据?

1 个答案:

答案 0 :(得分:1)

在用于开始连接之后,数据根本不存在。这是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
)