<p>(PHP 5, PHP 7)</p><p>简介</p><p>代表PHP和Mysql数据库之间的一个连接。</p><p>类摘要</p><p>MySQLi {</p><p>/* 属性 */</p><p>int $mysqli->affected_rows;</p><p>int $mysqli->connect_errno;</p><p>string $mysqli->connect_error;</p><p>int $errno;</p><p>array $mysqli->error_list;</p><p>string $mysqli->error;</p><p>int $mysqli->field_count;</p><p>string $mysqli->client_info;</p><p>int $mysqli->client_version;</p><p>string $mysqli->host_info;</p><p>string $mysqli->protocol_version;</p><p>string $mysqli->server_info;</p><p>int $mysqli->server_version;</p><p>string $mysqli->info;</p><p>mixed $mysqli->insert_id;</p><p>string $mysqli->sqlstate;</p><p>int $mysqli->thread_id;</p><p>int $mysqli->warning_count;</p><p>/* 方法 */</p><p>int mysqli_affected_rows ( mysqli $link )</p><p>bool mysqli::autocommit ( bool $mode )</p><p>public bool mysqli::begin_transaction ([ int $flags [, string $name ]] )</p><p>bool mysqli::change_user ( string $user , string $password , string $database )</p><p>string mysqli::character_set_name ( void )</p><p>bool mysqli::close ( void )</p><p>bool mysqli::commit ( void )</p><p>int mysqli_connect_errno ( void )</p><p>string mysqli_connect_error ( void )</p><p>void mysqli::connect ([ string $host = ini_get("mysqli.default_host") [, string $username = ini_get("mysqli.default_user") [, string $passwd = ini_get("mysqli.default_pw") [, string $dbname = "" [, int $port = ini_get("mysqli.default_port") [, string $socket = ini_get("mysqli.default_socket") ]]]]]] )</p><p>bool mysqli::debug ( string $message )</p><p>bool mysqli::dump_debug_info ( void )</p><p>int mysqli_errno ( mysqli $link )</p><p>array mysqli_error_list ( mysqli $link )</p><p>string mysqli_error ( mysqli $link )</p><p>int mysqli_field_count ( mysqli $link )</p><p>object mysqli::get_charset ( void )</p><p>string mysqli::get_client_info ( void )</p><p>int mysqli_get_client_version ( mysqli $link )</p><p>bool mysqli::get_connection_stats ( void )</p><p>string mysqli_get_host_info ( mysqli $link )</p><p>int mysqli_get_proto_info ( mysqli $link )</p><p>string mysqli_get_server_info ( mysqli $link )</p><p>int mysqli_get_server_version ( mysqli $link )</p><p>mysqli_warning mysqli::get_warnings ( void )</p><p>string mysqli_info ( mysqli $link )</p><p>mysqli mysqli::init ( void )</p><p>mixed mysqli_insert_id ( mysqli $link )</p><p>bool mysqli::kill ( int $processid )</p><p>bool mysqli::more_results ( void )</p><p>bool mysqli::multi_query ( string $query )</p><p>bool mysqli::next_result ( void )</p><p>bool mysqli::options ( int $option , mixed $value )</p><p>bool mysqli::ping ( void )</p><p>public static int mysqli::poll ( array &$read , array &$error , array &$reject , int $sec [, int $usec ] )</p><p>mysqli_stmt mysqli::prepare ( string $query )</p><p>mixed mysqli::query ( string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )</p><p>bool mysqli::real_connect ([ string $host [, string $username [, string $passwd [, string $dbname [, int $port [, string $socket [, int $flags ]]]]]]] )</p><p>string mysqli::escape_string ( string $escapestr )</p><p>bool mysqli::real_query ( string $query )</p><p>public mysqli_result mysqli::reap_async_query ( void )</p><p>public bool mysqli::refresh ( int $options )</p><p>public bool mysqli::release_savepoint ( string $name )</p><p>bool mysqli::rollback ( void )</p><p>int mysqli::rpl_query_type ( string $query )</p><p>public bool mysqli::savepoint ( string $name )</p><p>bool mysqli::select_db ( string $dbname )</p><p>bool mysqli::send_query ( string $query )</p><p>bool mysqli::set_charset ( string $charset )</p><p>void mysqli_set_local_infile_default ( mysqli $link )</p><p>bool mysqli::set_local_infile_handler ( mysqli $link , callable $read_func )</p><p>string mysqli_sqlstate ( mysqli $link )</p><p>bool mysqli::ssl_set ( string $key , string $cert , string $ca , string $capath , string $cipher )</p><p>string mysqli::stat ( void )</p><p>mysqli_stmt mysqli::stmt_init ( void )</p><p>mysqli_result mysqli::store_result ([ int $option ] )</p><p>int mysqli_thread_id ( mysqli $link )</p><p>bool mysqli_thread_safe ( void )</p><p>mysqli_result mysqli::use_result ( void )</p><p>int mysqli_warning_count ( mysqli $link )</p><p>}</p><p>Table of Contents</p><p>mysqli::$affected_rows — Gets the number of affected rows in a previous MySQL operation</p><p>mysqli::autocommit — 打开或关闭本次数据库连接的自动命令提交事务模式</p><p>mysqli::begin_transaction — Starts a transaction</p><p>mysqli::change_user — Changes the user of the specified database connection</p><p>mysqli::character_set_name — 返回当前数据库连接的默认字符编码</p><p>mysqli::close — 关闭先前打开的数据库连接</p><p>mysqli::commit — 提交一个事务</p><p>mysqli::$connect_errno — Returns the error code from last connect call</p><p>mysqli::$connect_error — Returns a string description of the last connect error</p><p>mysqli::__construct — Open a new connection to the MySQL server</p><p>mysqli::debug — Performs debugging operations</p><p>mysqli::dump_debug_info — 将调试信息输出到日志</p><p>mysqli::errno — 返回最近函数调用的错误代码</p><p>mysqli::$error_list — Returns a list of errors from the last command executed</p><p>mysqli::$error — Returns a string description of the last error</p><p>mysqli::$field_count — Returns the number of columns for the most recent query</p><p>mysqli::get_charset — Returns a character set object</p><p>mysqli::$client_info — Get MySQL client info</p><p>mysqli_get_client_version — 作为一个整数返回MySQL客户端的版本</p><p>mysqli::get_connection_stats — Returns statistics about the client connection</p><p>mysqli::$host_info — 返回一个表述使用的连接类型的字符串</p><p>mysqli::$protocol_version — 返回MySQL使用的协议版本号</p><p>mysqli::$server_info — 返回MySQL服务器的版本号</p><p>mysqli::$server_version — 作为一个整数返回MySQL服务器的版本</p><p>mysqli::get_warnings — Get result of SHOW WARNINGS</p><p>mysqli::$info — Retrieves information about the most recently executed query</p><p>mysqli::init — Initializes MySQLi and returns a resource for use with mysqli_real_connect()</p><p>mysqli::$insert_id — Returns the auto generated id used in the latest query</p><p>mysqli::kill — Asks the server to kill a MySQL thread</p><p>mysqli::more_results — Check if there are any more query results from a multi query</p><p>mysqli::multi_query — Performs a query on the database</p><p>mysqli::next_result — Prepare next result from multi_query</p><p>mysqli::options — Set options</p><p>mysqli::ping — Pings a server connection, or tries to reconnect if the connection has gone down</p><p>mysqli::poll — Poll connections</p><p>mysqli::prepare — Prepare an SQL statement for execution</p><p>mysqli::query — 对数据库执行一次查询</p><p>mysqli::real_connect — 建立一个 MySQL 服务器连接</p><p>mysqli::real_escape_string — Escapes special characters in a string for use in an SQL statement, taking into account the current charset of the connection</p><p>mysqli::real_query — 执行一个mysql查询</p><p>mysqli::reap_async_query — Get result from async query</p><p>mysqli::refresh — Refreshes</p><p>mysqli::release_savepoint — Removes the named savepoint from the set of savepoints of the current transaction</p><p>mysqli::rollback — 回退当前事务</p><p>mysqli::rpl_query_type — Returns RPL query type</p><p>mysqli::savepoint — Set a named transaction savepoint</p><p>mysqli::select_db — 选择用于数据库查询的默认数据库</p><p>mysqli::send_query — 发送请求并返回结果</p><p>mysqli::set_charset — 设置默认字符编码</p><p>mysqli::set_local_infile_default — Unsets user defined handler for load local infile command</p><p>mysqli::set_local_infile_handler — Set callback function for LOAD DATA LOCAL INFILE command</p><p>mysqli::$sqlstate — Returns the SQLSTATE error from previous MySQL operation</p><p>mysqli::ssl_set — Used for establishing secure connections using SSL</p><p>mysqli::stat — Gets the current system status</p><p>mysqli::stmt_init — 初始化一条语句并返回一个用于mysqli_stmt_prepare(调用)的对象</p><p>mysqli::store_result — Transfers a result set from the last query</p><p>mysqli::$thread_id — Returns the thread ID for the current connection</p><p>mysqli::thread_safe — 返回是否是线程安全的</p><p>mysqli::use_result — Initiate a result set retrieval</p><p>mysqli::$warning_count — Returns the number of warnings from the last query for the given link</p>