<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.mysql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'ref.mysql.php',
    1 => 'MySQL 函数',
    2 => 'MySQL 函数',
  ),
  'up' => 
  array (
    0 => 'book.mysql.php',
    1 => 'Mysql（原始）',
  ),
  'prev' => 
  array (
    0 => 'mysql.examples-basic.php',
    1 => 'MySQL 扩展概述范例',
  ),
  'next' => 
  array (
    0 => 'function.mysql-affected-rows.php',
    1 => 'mysql_affected_rows',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/mysql/reference.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/ref.mysql.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ref.mysql" class="reference">
  <h1 class="title">MySQL 函数</h1>

  <div class="partintro">
   <div class="section" id="mysql.notes">
   <h2 class="title">注释</h2>
    <blockquote class="note"><p><strong class="note">注意</strong>: 
     <span class="simpara">
      大多数 MySQL 函数的最后一个可选参数是 <code class="parameter">link_identifier</code>。
      如果没有提供这个参数，则会使用最后一个打开的连接。
      若不存在这个最后打开的连接，则会尝试用 <var class="filename">php.ini</var> 里定义的默认参数来连接。
      如果没有成功连接，函数会返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
     </span>
    </p></blockquote>
   </div>
  </div>


















































































































































































































































































































































 <h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="function.mysql-affected-rows.php">mysql_affected_rows</a> — 取得前一次 MySQL 操作所影响的记录行数</li><li><a href="function.mysql-client-encoding.php">mysql_client_encoding</a> — 返回字符集的名称</li><li><a href="function.mysql-close.php">mysql_close</a> — 关闭 MySQL 连接</li><li><a href="function.mysql-connect.php">mysql_connect</a> — 打开一个到 MySQL 服务器的连接</li><li><a href="function.mysql-create-db.php">mysql_create_db</a> — 新建一个 MySQL 数据库</li><li><a href="function.mysql-data-seek.php">mysql_data_seek</a> — 移动内部结果的指针</li><li><a href="function.mysql-db-name.php">mysql_db_name</a> — 取得 mysql_list_dbs 返回的结果数据</li><li><a href="function.mysql-db-query.php">mysql_db_query</a> — 选择数据库并执行查询</li><li><a href="function.mysql-drop-db.php">mysql_drop_db</a> — 丢弃（删除）一个 MySQL 数据库</li><li><a href="function.mysql-errno.php">mysql_errno</a> — 返回上一个 MySQL 操作中的错误信息的数值</li><li><a href="function.mysql-error.php">mysql_error</a> — 返回上一个 MySQL 操作中的错误信息的文本</li><li><a href="function.mysql-escape-string.php">mysql_escape_string</a> — 转义字符串用于 mysql_query</li><li><a href="function.mysql-fetch-array.php">mysql_fetch_array</a> — 从结果集中取得一行作为关联数组</li><li><a href="function.mysql-fetch-assoc.php">mysql_fetch_assoc</a> — 从结果集中取得一行作为关联数组</li><li><a href="function.mysql-fetch-field.php">mysql_fetch_field</a> — 从结果集中取得列信息并作为对象返回</li><li><a href="function.mysql-fetch-lengths.php">mysql_fetch_lengths</a> — 取得结果集中每个输出的长度</li><li><a href="function.mysql-fetch-object.php">mysql_fetch_object</a> — 从结果集中取得一行作为对象返回</li><li><a href="function.mysql-fetch-row.php">mysql_fetch_row</a> — 从结果集中取得一行作为枚举数组</li><li><a href="function.mysql-field-flags.php">mysql_field_flags</a> — 从结果中取得和指定字段关联的 flags</li><li><a href="function.mysql-field-len.php">mysql_field_len</a> — 返回指定字段的长度</li><li><a href="function.mysql-field-name.php">mysql_field_name</a> — 取得结果中指定字段的字段名</li><li><a href="function.mysql-field-seek.php">mysql_field_seek</a> — 将结果指针设置为指定的字段偏移量</li><li><a href="function.mysql-field-table.php">mysql_field_table</a> — 取得指定字段所在的表名</li><li><a href="function.mysql-field-type.php">mysql_field_type</a> — 取得结果集中指定字段的类型</li><li><a href="function.mysql-free-result.php">mysql_free_result</a> — 释放结果内存</li><li><a href="function.mysql-get-client-info.php">mysql_get_client_info</a> — 取得 MySQL 客户端信息</li><li><a href="function.mysql-get-host-info.php">mysql_get_host_info</a> — 取得 MySQL 主机信息</li><li><a href="function.mysql-get-proto-info.php">mysql_get_proto_info</a> — 取得 MySQL 协议信息</li><li><a href="function.mysql-get-server-info.php">mysql_get_server_info</a> — 取得 MySQL 服务器信息</li><li><a href="function.mysql-info.php">mysql_info</a> — 获取最近查询的有关信息</li><li><a href="function.mysql-insert-id.php">mysql_insert_id</a> — 取得上一条查询生成的 ID</li><li><a href="function.mysql-list-dbs.php">mysql_list_dbs</a> — 列出 MySQL 服务器中可用的数据库</li><li><a href="function.mysql-list-fields.php">mysql_list_fields</a> — 列出 MySQL 表字段</li><li><a href="function.mysql-list-processes.php">mysql_list_processes</a> — 列出 MySQL 进程</li><li><a href="function.mysql-list-tables.php">mysql_list_tables</a> — 列出 MySQL 数据库中的表</li><li><a href="function.mysql-num-fields.php">mysql_num_fields</a> — 取得结果中字段的数量</li><li><a href="function.mysql-num-rows.php">mysql_num_rows</a> — 获取结果中行数</li><li><a href="function.mysql-pconnect.php">mysql_pconnect</a> — 打开一个到 MySQL 服务器的持久连接</li><li><a href="function.mysql-ping.php">mysql_ping</a> — Ping 服务器连接的状态，如果没有连接则重新连接</li><li><a href="function.mysql-query.php">mysql_query</a> — 发送一条 MySQL 查询</li><li><a href="function.mysql-real-escape-string.php">mysql_real_escape_string</a> — 将字符串中的特殊字符进行转义，以在 SQL 语句中使用</li><li><a href="function.mysql-result.php">mysql_result</a> — 取得结果数据</li><li><a href="function.mysql-select-db.php">mysql_select_db</a> — 选择 MySQL 数据库</li><li><a href="function.mysql-set-charset.php">mysql_set_charset</a> — 设置客户端的字符集</li><li><a href="function.mysql-stat.php">mysql_stat</a> — 获取当前系统状态</li><li><a href="function.mysql-tablename.php">mysql_tablename</a> — 取得表名</li><li><a href="function.mysql-thread-id.php">mysql_thread_id</a> — 返回当前线程的 ID</li><li><a href="function.mysql-unbuffered-query.php">mysql_unbuffered_query</a> — 向 MySQL 发送 SQL 查询，无需获取和缓冲结果行</li></ul>
</div>
<?php manual_footer($setup); ?>