<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mysqli.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'mysqli.options.php',
    1 => 'mysqli::options',
    2 => 'オプションを設定する',
  ),
  'up' => 
  array (
    0 => 'class.mysqli.php',
    1 => 'mysqli',
  ),
  'prev' => 
  array (
    0 => 'mysqli.next-result.php',
    1 => 'mysqli::next_result',
  ),
  'next' => 
  array (
    0 => 'mysqli.ping.php',
    1 => 'mysqli::ping',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/mysqli/mysqli/options.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mysqli.options" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqli::options</h1>
  <h1 class="refname">mysqli_options</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mysqli::options</span> -- <span class="refname">mysqli_options</span> &mdash; <span class="dc-title">オプションを設定する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mysqli.options-description">
  <h3 class="title">説明</h3>
  <p class="para">オブジェクト指向型</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>mysqli::options</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$option</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$value</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">手続き型</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>mysqli_options</strong></span>(<span class="methodparam"><span class="type"><a href="class.mysqli.php" class="type mysqli">mysqli</a></span> <code class="parameter">$mysql</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$option</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$value</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   接続に関する追加オプションを設定し、
   接続の振る舞いに影響を与えるために使用します。
  </p>
  <p class="para">
   この関数は、いくつかのオプションを設定して複数回コールされることがあります。
  </p>
  <p class="para">
   <span class="function"><strong>mysqli_options()</strong></span> は、
   <span class="function"><a href="mysqli.init.php" class="function">mysqli_init()</a></span> がコールされた後、
   <span class="function"><a href="mysqli.real-connect.php" class="function">mysqli_real_connect()</a></span> の前にコールしなければなりません。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mysqli.options-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    <dt><code class="parameter">link</code></dt><dd><p class="para">手続き型のみ:
<span class="function"><a href="function.mysqli-connect.php" class="function">mysqli_connect()</a></span> あるいは <span class="function"><a href="mysqli.init.php" class="function">mysqli_init()</a></span> が返す <span class="classname"><a href="class.mysqli.php" class="classname">mysqli</a></span>オブジェクト。
</p></dd>
    
     <dt><code class="parameter">option</code></dt>
     <dd>
      <p class="para">
       指定するオプション。以下の値のいずれかです。
       <table id="mysqli.options.parameters" class="doctable table">
        <caption><strong>使用可能なオプション</strong></caption>
        
         <thead>
          <tr>
           <th>名前</th>
           <th>説明</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-connect-timeout">MYSQLI_OPT_CONNECT_TIMEOUT</a></code></strong></td>
           <td>接続のタイムアウト秒数</td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-read-timeout">MYSQLI_OPT_READ_TIMEOUT</a></code></strong></td>
           <td>コマンドの実行結果が返ってくるまでのタイムアウト秒数。PHP 7.2.0 以降で利用可能です。</td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-local-infile">MYSQLI_OPT_LOCAL_INFILE</a></code></strong></td>
           <td><code class="literal">LOAD LOCAL INFILE</code> の使用可/不可。</td>
          </tr>

          <tr>
           <td><strong><code>MYSQLI_OPT_LOAD_DATA_LOCAL_DIR</code></strong></td>
           <td>
            <code class="literal">LOAD DATA LOCAL INFILE</code> で使用するディレクトリ。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-init-command">MYSQLI_INIT_COMMAND</a></code></strong></td>
           <td>MySQL サーバーへの接続後に実行するコマンド。</td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-set-charset-name">MYSQLI_SET_CHARSET_NAME</a></code></strong></td>
           <td>文字コードのデフォルト値</td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-read-default-file">MYSQLI_READ_DEFAULT_FILE</a></code></strong></td>
           <td>
            <var class="filename">my.cnf</var> の代わりに、指定した名前のファイルから
            設定を読み込みます。
            mysqlnd ではサポートされていません。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-read-default-group">MYSQLI_READ_DEFAULT_GROUP</a></code></strong></td>
           <td>
            <var class="filename">my.cnf</var> の指定した名前のグループ、あるいは
            <strong><code>MYSQL_READ_DEFAULT_FILE</code></strong> で指定したファイルから
            設定を読み込みます。
            mysqlnd ではサポートされていません。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-server-public-key">MYSQLI_SERVER_PUBLIC_KEY</a></code></strong></td>
           <td>
             RSA 公開鍵ファイル。SHA-256 ベースの認証で使います。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-net-cmd-buffer-size">MYSQLI_OPT_NET_CMD_BUFFER_SIZE</a></code></strong></td>
           <td>
             内部のコマンド／ネットワークバッファのサイズ。
             mysqlnd でのみ有効です。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-net-read-buffer-size">MYSQLI_OPT_NET_READ_BUFFER_SIZE</a></code></strong></td>
           <td>
             MySQL コマンドパケットのボディを読み込むときの、読み込みチャンクの最大バイト数。
             mysqlnd でのみ有効です。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-int-and-float-native">MYSQLI_OPT_INT_AND_FLOAT_NATIVE</a></code></strong></td>
           <td>
             プリペアドステートメントを使わない場合に、
             integer 型と float 型のカラムを PHP の数値に変換します。
             mysqlnd でのみ有効です。
           </td>
          </tr>

          <tr>
           <td><strong><code><a href="mysqli.constants.php#constant.mysqli-opt-ssl-verify-server-cert">MYSQLI_OPT_SSL_VERIFY_SERVER_CERT</a></code></strong></td>
           <td>
             サーバーの証明書を検証するかしないかを指定します。
           </td>
          </tr>

          <tr>
           <td><strong><code>MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS</code></strong></td>
           <td>
            クライアントが期限切れのパスワードを受け入れるかどうかを指定します。
           </td>
          </tr>

          <tr>
           <td><code class="literal">1</code></td>
           <td>
            ネットワーク通信の圧縮を使用するかどうかを指定します。
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       オプションに設定する値。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mysqli.options-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を、失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-mysqli.options-errors">
  <h3 class="title">エラー / 例外</h3>
  <p class="para">
mysqli のエラー報告 (<strong><code><a href="mysqli.constants.php#constant.mysqli-report-error">MYSQLI_REPORT_ERROR</a></code></strong>) が有効になっており、かつ要求された操作が失敗した場合は、警告が発生します。さらに、エラー報告のモードが <strong><code><a href="mysqli.constants.php#constant.mysqli-report-strict">MYSQLI_REPORT_STRICT</a></code></strong> に設定されていた場合は、<span class="classname"><a href="class.mysqli-sql-exception.php" class="classname">mysqli_sql_exception</a></span> が代わりにスローされます。</p>
 </div>


 <div class="refsect1 examples" id="refsect1-mysqli.options-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <span class="function"><a href="mysqli.real-connect.php" class="function">mysqli_real_connect()</a></span> を参照ください。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-mysqli.options-notes">
  <h3 class="title">注意</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
<p class="para">MySQLnd は常に、サーバーのデフォルト文字セットを想定しています。この文字セットは接続時の
ハンドシェイク/認証 のときに送信され、これを mysqlnd が使います。</p>
<p class="para">Libmysqlclient が使うデフォルトの文字セットは <var class="filename">my.cnf</var>
で設定したものです。あるいは明示的に <span class="function"><strong>mysqli_options()</strong></span> をコールして設定することもできます。
これは、<span class="function"><a href="mysqli.init.php" class="function">mysqli_init()</a></span> のあとで <span class="function"><a href="mysqli.real-connect.php" class="function">mysqli_real_connect()</a></span>
を実行する前にコールします。</p></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-mysqli.options-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="mysqli.init.php" class="function" rel="rdfs-seeAlso">mysqli_init()</a> - MySQLi を初期化し、mysqli_real_connect() で使うオブジェクトを返す</span></li>
    <li><span class="function"><a href="mysqli.real-connect.php" class="function" rel="rdfs-seeAlso">mysqli_real_connect()</a> - mysql サーバーとの接続をオープンする</span></li>
   </ul>
  </p>
 </div>


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