PHP 5 MySQLi 函数
<div id="article_content" class="article_content clearfix"><link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">
<link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-6e43165c0a.css">
<div id="content_views" class="htmledit_views">
<h1>PHP 5 MySQLi 函数</h1>
<hr>
<h2>PHP MySQLi 简介</h2>
<p><strong>PHP MySQLi = PHP MySQL Improved!</strong></p>
<p>MySQLi 函数允许您访问 MySQL 数据库服务器。</p>
<p><strong>注释:</strong>MySQLi 扩展被设计用于 MySQL 4.1.13 版本或更新的版本。</p>
<hr>
<h2>安装 / Runtime 配置</h2>
<p>为了能够顺利使用 MySQLi 函数,您必须在编译 PHP 时添加对 MySQLi 扩展的支持。</p>
<p>MySQLi 扩展是在 PHP 5.0.0 版本中引进的。MySQL Native Driver 包含在 PHP 5.3.0 版本。</p>
<p>有关安装的详细信息,请访问: <ahref="http://www.php.net/manual/en/mysqli.installation.php">PHP: Installation - Manual</a></p>
<p>有关运行配置的详细信息,请访问: <ahref="http://www.php.net/manual/en/mysqli.configuration.php">PHP: Runtime Configuration - Manual</a></p>
<hr>
<h2>PHP 5 MySQLi 函数</h2>
<table><tbody><tr><th>函数</th><th>描述</th></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-affected-rows.html">mysqli_affected_rows()</a></td><td>返回前一次 MySQL 操作所影响的记录行数。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-autocommit.html">mysqli_autocommit()</a></td><td>打开或关闭自动提交数据库修改。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-change-user.html">mysqli_change_user()</a></td><td>更改指定数据库连接的用户。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-character-set-name.html">mysqli_character_set_name()</a></td><td>返回数据库连接的默认字符集。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-close.html">mysqli_close()</a></td><td>关闭先前打开的数据库连接。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-commit.html">mysqli_commit()</a></td><td>提交当前事务。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-connect-errno.html">mysqli_connect_errno()</a></td><td>返回上一次连接错误的错误代码。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-connect-error.html">mysqli_connect_error()</a></td><td>返回上一次连接错误的错误描述。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-connect.html">mysqli_connect()</a></td><td>打开一个到 MySQL 服务器的新的连接。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-data-seek.html">mysqli_data_seek()</a></td><td>调整结果指针到结果集中的一个任意行。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-debug.html">mysqli_debug()</a></td><td>执行调试操作。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-dump-debug-info.html">mysqli_dump_debug_info()</a></td><td>转储调试信息到日志中。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-errno.html">mysqli_errno()</a></td><td>返回最近调用函数的最后一个错误代码。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-error-list.html">mysqli_error_list()</a></td><td>返回最近调用函数的错误列表。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-error.html">mysqli_error()</a></td><td>返回最近调用函数的最后一个错误描述。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-all.html">mysqli_fetch_all()</a></td><td>从结果集中取得所有行作为关联数组,或数字数组,或二者兼有。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-array.html">mysqli_fetch_array()</a></td><td>从结果集中取得一行作为关联数组,或数字数组,或二者兼有。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-assoc.html">mysqli_fetch_assoc()</a></td><td>从结果集中取得一行作为关联数组。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-field-direct.html">mysqli_fetch_field_direct()</a></td><td>从结果集中取得某个单一字段的 meta-data,并作为对象返回。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-field.html">mysqli_fetch_field()</a></td><td>从结果集中取得下一字段,并作为对象返回。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-fields.html">mysqli_fetch_fields()</a></td><td>返回结果中代表字段的对象的数组。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-lengths.html">mysqli_fetch_lengths()</a></td><td>返回结果集中当前行的每个列的长度。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-object.html">mysqli_fetch_object()</a></td><td>从结果集中取得当前行,并作为对象返回。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-fetch-row.html">mysqli_fetch_row()</a></td><td>从结果集中取得一行,并作为枚举数组返回。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-field-count.html">mysqli_field_count()</a></td><td>返回最近查询的列数。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-field-seek.html">mysqli_field_seek()</a></td><td>把结果集中的指针设置为指定字段的偏移量。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-field-tell.html">mysqli_field_tell()</a></td><td>返回结果集中的指针的位置。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-free-result.html">mysqli_free_result()</a></td><td>释放结果内存。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-charset.html">mysqli_get_charset()</a></td><td>返回字符集对象。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-client-info.html">mysqli_get_client_info()</a></td><td>返回 MySQL 客户端库版本。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-client-stats.html">mysqli_get_client_stats()</a></td><td>返回有关客户端每个进程的统计。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-client-version.html">mysqli_get_client_version()</a></td><td>将 MySQL 客户端库版本作为整数返回。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-connection-stats.html">mysqli_get_connection_stats()</a></td><td>返回有关客户端连接的统计。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-host-info.html">mysqli_get_host_info()</a></td><td>返回 MySQL 服务器主机名和连接类型。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-proto-info.html">mysqli_get_proto_info()</a></td><td>返回 MySQL 协议版本。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-server-info.html">mysqli_get_server_info()</a></td><td>返回 MySQL 服务器版本。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-get-server-version.html">mysqli_get_server_version()</a></td><td>将 MySQL 服务器版本作为整数返回。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-info.html">mysqli_info()</a></td><td>返回有关最近执行查询的信息。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-init.html">mysqli_init()</a></td><td>初始化 MySQLi 并返回 mysqli_real_connect() 使用的资源。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-insert-id.html">mysqli_insert_id()</a></td><td>返回最后一个查询中自动生成的 ID。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-kill.html">mysql_kill()</a></td><td>请求服务器杀死一个 MySQL 线程。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-more-results.html">mysqli_more_results()</a></td><td>检查一个多查询是否有更多的结果。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-multi-query.html">mysqli_multi_query()</a></td><td>执行一个或多个针对数据库的查询。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-next-result.html">mysqli_next_result()</a></td><td>为 mysqli_multi_query() 准备下一个结果集。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-num-fields.html">mysqli_num_fields()</a></td><td>返回结果集中字段的数量。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-num-rows.html">mysqli_num_rows()</a></td><td>返回结果集中行的数量。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-options.html">mysqli_options()</a></td><td>设置额外的连接选项,用于影响连接行为。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-ping.html">mysqli_ping()</a></td><td>进行一个服务器连接,如果连接已断开则尝试重新连接。</td></tr><tr><td>mysqli_prepare()</td><td>准备执行一个 SQL 语句。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-query.html">mysqli_query()</a></td><td>执行某个针对数据库的查询。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-real-connect.html">mysqli_real_connect()</a></td><td>打开一个到 MySQL 服务器的新的链接。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-real-escape-string.html">mysqli_real_escape_string()</a></td><td>转义在 SQL 语句中使用的字符串中的特殊字符。</td></tr><tr><td>mysqli_real_query()</td><td>执行 SQL 查询</td></tr><tr><td>mysqli_reap_async_query()</td><td>返回异步查询的结果。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-refresh.html">mysqli_refresh()</a></td><td>刷新表或缓存,或者重置复制服务器信息。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-rollback.html">mysqli_rollback()</a></td><td>回滚数据库中的当前事务。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-select-db.html">mysqli_select_db()</a></td><td>更改连接的默认数据库。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-set-charset.html">mysqli_set_charset()</a></td><td>设置默认客户端字符集。</td></tr><tr><td>mysqli_set_local_infile_default()</td><td>撤销用于 load local infile 命令的用户自定义句柄。</td></tr><tr><td>mysqli_set_local_infile_handler()</td><td>设置用于 LOAD DATA LOCAL INFILE 命令的回滚函数。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-sqlstate.html">mysqli_sqlstate()</a></td><td>返回最后一个 MySQL 操作的 SQLSTATE 错误代码。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-ssl-set.html">mysqli_ssl_set()</a></td><td>用于创建 SSL 安全连接。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-stat.html">mysqli_stat()</a></td><td>返回当前系统状态。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-stmt-init.html">mysqli_stmt_init()</a></td><td>初始化声明并返回 mysqli_stmt_prepare() 使用的对象。</td></tr><tr><td>mysqli_store_result()</td><td>返回的当前的结果集。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-thread-id.html">mysqli_thread_id()</a></td><td>返回当前连接的线程 ID。</td></tr><tr><td><ahref="https://www.runoob.com/php/func-mysqli-thread-safe.html">mysqli_thread_safe()</a></td><td>返回是否将客户端库编译成 thread-safe。</td></tr><tr><td>mysqli_use_result()</td><td>从上次使用 mysqli_real_query() 执行的查询中初始化结果集的检索。</td></tr><tr><td>mysqli_warning_count()</td><td>返回连接中的最后一个查询的警告数量。</td></tr></tbody></table>
</div>
</div>
<div id="treeSkill"></div>
页:
[1]