<?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 => 'ru',
  ),
  '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' => 'ru',
    '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">mysql</code></dt><dd><p class="para">Только для процедурного стиля: объект <span class="classname"><a href="class.mysqli.php" class="classname">mysqli</a></span>, который вернула функция
<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>.
</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><a href="mysqli.constants.php#constant.mysqli-opt-load-data-local-dir">MYSQLI_OPT_LOAD_DATA_LOCAL_DIR</a></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><a href="mysqli.constants.php#constant.mysqli-opt-can-handle-expired-passwords">MYSQLI_OPT_CAN_HANDLE_EXPIRED_PASSWORDS</a></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.real-connect.php" class="function">mysqli_real_connect()</a></span>, но после вызова функции <span class="function"><a href="function.mysqli-connect.php" class="function">mysqli_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); ?>