<?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 => 'mysql.constants.php',
    1 => '预定义常量',
    2 => '预定义常量',
  ),
  'up' => 
  array (
    0 => 'book.mysql.php',
    1 => 'Mysql（原始）',
  ),
  'prev' => 
  array (
    0 => 'changelog.mysql.php',
    1 => '更新日志',
  ),
  'next' => 
  array (
    0 => 'mysql.examples.php',
    1 => '示例',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/mysql/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysql.constants" class="appendix">
 <h1 class="title">预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
 <p class="para">
  允许在
  <span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span> 函数和 <span class="function"><a href="function.mysql-pconnect.php" class="function">mysql_pconnect()</a></span>
  函数中指定更多的客户端标记。下面列出所定义的常量：
  <table id="mysql.client-flags" class="doctable table">
   <caption><strong>MySQL 客户端常量</strong></caption>
    
     <thead>
      <tr>
       <th>常量</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr id="constant.mysql-client-compress">
       <td><strong><code><a href="mysql.constants.php#constant.mysql-client-compress">MYSQL_CLIENT_COMPRESS</a></code></strong></td>
       <td>使用压缩的通讯协议</td>
      </tr>

      <tr id="constant.mysql-client-ignore-space">
       <td><strong><code><a href="mysql.constants.php#constant.mysql-client-ignore-space">MYSQL_CLIENT_IGNORE_SPACE</a></code></strong></td>
       <td>允许在函数名后留空格位</td>
      </tr>

      <tr id="constant.mysql-client-interactive">
       <td><strong><code><a href="mysql.constants.php#constant.mysql-client-interactive">MYSQL_CLIENT_INTERACTIVE</a></code></strong></td>
       <td>允许设置断开连接之前所空闲等候的 interactive_timeout 时间（代替 wait_timeout）。</td>
      </tr>

      <tr id="constant.mysql-client-ssl">
       <td><strong><code><a href="mysql.constants.php#constant.mysql-client-ssl">MYSQL_CLIENT_SSL</a></code></strong></td>
       <td>
        使用 SSL 加密。本标志仅在 MySQL 客户端库版本为
        4.x 或更高版本时可用。在 PHP 4 和 Windows 版的 PHP 5
        安装包中绑定的都是 3.23.x。
       </td>
      </tr>

     </tbody>
    
  </table>

 </p>

 <p class="para">
  <span class="function"><a href="function.mysql-fetch-array.php" class="function">mysql_fetch_array()</a></span> 函数使用一个常量来表示所返回数组的类型。下面是常量的定义：
  <table id="mysql.constants.fetch" class="doctable table">
   <caption><strong>MySQL fetch 常量</strong></caption>
   
    <thead>
     <tr>
      <th>常量</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr id="constant.mysql-assoc">
      <td><strong><code><a href="mysql.constants.php#constant.mysql-assoc">MYSQL_ASSOC</a></code></strong></td>
      <td>
       返回的数据列使用字段名作为数组的索引名。
      </td>
     </tr>

     <tr id="constant.mysql-both">
      <td><strong><code><a href="mysql.constants.php#constant.mysql-both">MYSQL_BOTH</a></code></strong></td>
      <td>
       返回的数据列使用字段名及数字索引作为数组的索引名。
      </td>
     </tr>

     <tr id="constant.mysql-num">
      <td><strong><code><a href="mysql.constants.php#constant.mysql-num">MYSQL_NUM</a></code></strong></td>
      <td>
       返回的数据列使用数字索引作为数组的索引名。索引从 0 开始，表示返回结果的第一个字段。
      </td>
     </tr>

    </tbody>
   
  </table>

 </p>
</div>
<?php manual_footer($setup); ?>