PHP 5 MySQLi funktioner

PHP MySQLi 简介

PHP MySQLi = PHP MySQL Improved!

MySQLi 函数允许您访问 MySQL 数据库服务器。

注释:MySQLi 扩展被设计为适用于 MySQL 版本 4.1.13 或更新的版本。

安装 / Runtime 配置

为了使 MySQLi 可用,您必须对 PHP 进行编译,以支持 MySQLi 扩展。

MySQLi 扩展通过 PHP 版本 5.0.0 引入。PHP version 5.0.0 MySQL 本地驱动程序包含在 PHP 5.3.0 版。

如需安装细节,请访问:http://www.php.net/manual/zh/mysqli.installation.php

如需运行时配置细节,请访问:http://www.php.net/manual/zh/mysqli.configuration.php

PHP 5 MySQLi funktioner

函数 描述
mysqli_affected_rows() 返回前一个 Mysql 操作的受影响行数。
mysqli_autocommit() 打开或关闭自动提交数据库修改功能。
mysqli_change_user() 更改指定数据库连接的用户。
mysqli_character_set_name() 返回数据库连接的默认字符集。
mysqli_close() 关闭先前打开的数据库连接。
mysqli_commit() 提交当前事务。
mysqli_connect_errno() 返回最后一次连接调用的错误代码。
mysqli_connect_error() 返回上一次连接错误的错误描述。
mysqli_connect() 打开到 Mysql 服务器的新连接。
mysqli_data_seek() 调整结果指针到结果集中的一个任意行。
mysqli_debug() 执行调试操作。
mysqli_dump_debug_info() 转储调试信息到日志中。
mysqli_errno() 返回最近的函数调用产生的错误代码。
mysqli_error_list() 返回最近的函数调用产生的错误列表。
mysqli_error() 返回字符串描述的最近一次函数调用产生的错误代码。
mysqli_fetch_all() 抓取所有的结果行并且以关联数据,数值索引数组,或者两者皆有的方式返回结果集。
mysqli_fetch_array() 以一个关联数组,数值索引数组,或者两者皆有的方式抓取一行结果。
mysqli_fetch_assoc() 以一个关联数组方式抓取一行结果。
mysqli_fetch_field_direct() 以对象返回结果集中单字段的元数据。
mysqli_fetch_field() 以对象返回结果集中的下一个字段。
mysqli_fetch_fields() 返回代表结果集中字段的对象数组。
mysqli_fetch_lengths() 返回结果集中当前行的列长度。
mysqli_fetch_object() 以对象返回结果集的当前行。
mysqli_fetch_row() 从结果集中抓取一行并以枚举数组的形式返回它。
mysqli_field_count() 返回最近一次查询获取到的列的数目。
mysqli_field_seek() 设置字段指针到特定的字段开始位置。
mysqli_field_tell() 返回字段指针的位置。
mysqli_free_result() 释放与某个结果集相关的内存。
mysqli_get_charset() 返回字符集对象。
mysqli_get_client_info() 返回字符串类型的 Mysql 客户端版本信息。
mysqli_get_client_stats() Return statistical information of each client process.
mysqli_get_client_version() Return integer Mysql client version information.
mysqli_get_connection_stats() Return statistical information of the client connection.
mysqli_get_host_info() Return MySQL server hostname and connection type.
mysqli_get_proto_info() Return MySQL protocol version.
mysqli_get_server_info() Return MySQL server version.
mysqli_get_server_version() Return integer MySQL server version information.
mysqli_info() Return the retrieval information of the last executed query.
mysqli_init() Initialize mysqli and return the resource type used by mysqli_real_connect().
mysqli_insert_id() Return the automatically generated id used in the last query.
mysql_kill() Request the server to terminate a MySQL thread.
mysqli_more_results() Check if there are more query result sets in a multi-statement query.
mysqli_multi_query() Execute one or more queries on the database.
mysqli_next_result() Prepare the next result set from mysqli_multi_query().
mysqli_num_fields() Return the number of fields in the result set.
mysqli_num_rows() Return the number of rows in the result set.
mysqli_options() Set options.
mysqli_ping() Ping a server connection or try to reconnect if that connection is broken.
mysqli_prepare() Prepare an SQL statement for execution.
mysqli_query() Execute query on the database.
mysqli_real_connect() Open a new connection to the Mysql server.
mysqli_real_escape_string() Escape special characters in the string used in the SQL statement.
mysqli_real_query() Execute SQL query.
mysqli_reap_async_query() Return the result of the asynchronous query.
mysqli_refresh() Opfrisk tabellen eller cachen, eller nulstil kopierværtsinformationen.
mysqli_rollback() Rul tilbage den aktuelle transaktion.
mysqli_select_db() Ændr forbindelsens standard database.
mysqli_set_charset() Sæt standard klienttegnsæt.
mysqli_set_local_infile_default() Ryd brugerdefinerede behandlere for load local infile-kommandoen.
mysqli_set_local_infile_handler() Sæt op en callback-funktion til at udføre LOAD DATA LOCAL INFILE-kommandoen.
mysqli_sqlstate() Returner SQLSTATE-fejlkoden fra den tidligere Mysql-operering.
mysqli_ssl_set() Opret en installeret forbindelse ved hjælp af SSL.
mysqli_stat() Returner den aktuelle systemstatus.
mysqli_stmt_init() Initialiser en sætning og returner et objekt, der bruges af mysqli_stmt_prepare().
mysqli_store_result() Overfør resultatsættet fra den sidste forespørgsel.
mysqli_thread_id() Returner tråd ID'et for den aktuelle forbindelse.
mysqli_thread_safe() Returner om trådsikkerhed er sat op.
mysqli_use_result() Initialiser en resultatsæt til at hente tilbage.
mysqli_warning_count() Returner antallet af advarsler fra den sidste forespørgsel i forbindelsen.