<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mysql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.mysql-set-charset.php',
    1 => 'mysql_set_charset',
    2 => 'Sets the client character set',
  ),
  'up' => 
  array (
    0 => 'ref.mysql.php',
    1 => 'MySQL Функції',
  ),
  'prev' => 
  array (
    0 => 'function.mysql-select-db.php',
    1 => 'mysql_select_db',
  ),
  'next' => 
  array (
    0 => 'function.mysql-stat.php',
    1 => 'mysql_stat',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mysql/functions/mysql-set-charset.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mysql-set-charset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysql_set_charset</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.3)</p><p class="refpurpose"><span class="refname">mysql_set_charset</span> &mdash; <span class="dc-title">Sets the client character set</span></p>

 </div>

 <div id="function.mysql-set-charset-refsynopsisdiv">
  <div class="warning"><strong class="warning">Увага</strong>
   <p class="para">Це розширення застаріле, починаючи
з PHP 5.5.0, та вилучене з PHP 7.0.0. Натомість використовуються розширення
<a href="book.mysqli.php" class="link">MySQLi</a> або
<a href="ref.pdo-mysql.php" class="link">PDO_MySQL</a>. Докладніше описано у керівництві
<a href="mysqlinfo.api.choosing.php" class="link">MySQL: вибір API</a>.
Цю функцію можна замінити на:</p>
   <ul class="simplelist">
    <li><span class="function"><a href="mysqli.set-charset.php" class="function">mysqli_set_charset()</a></span></li>
    <li>PDO: Add <code class="literal">charset</code> to the connection string, such as <code class="literal">charset=utf8</code></li>
   </ul>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.mysql-set-charset-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mysql_set_charset</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$charset</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link_identifier</code><span class="initializer"> = NULL</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Sets the default character set for the current connection.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mysql-set-charset-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">charset</code></dt>
     <dd>
      <p class="para">
       A valid character set name.
      </p>
     </dd>
    
    <dt>
<code class="parameter">link_identifier</code></dt><dd><p class="para">З&#039;єднання
MySQL. Якщо не задано, буде обрано останнє з&#039;єднання, встановлене функцією
<span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span>. Якщо з&#039;єднатися не вдалось, функція
спробує встановити нове, ніби викликавши функцію
<span class="function"><a href="function.mysql-connect.php" class="function">mysql_connect()</a></span> без параметрів. Якщо з&#039;єднання не
вдалося знайти або встановити, буде виведено повідомлення рівня
<strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong></p></dd>
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mysql-set-charset-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 notes" id="refsect1-function.mysql-set-charset-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    This function requires MySQL 5.0.7 or later.
   </p>
  </p></blockquote>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    This is the preferred way to change the charset. Using
    <span class="function"><a href="function.mysql-query.php" class="function">mysql_query()</a></span> to set it (such as <code class="literal">SET NAMES utf8</code>)
    is not recommended. See the <a href="mysqlinfo.concepts.charset.php" class="link">MySQL character set concepts</a>
    section for more information.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mysql-set-charset-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="mysqlinfo.concepts.charset.php" class="link">Setting character sets in MySQL</a></li>
    <li><a href="http://dev.mysql.com/doc/mysql/en/charset-charsets.html" class="link external">&raquo;&nbsp;List of character sets that MySQL supports</a></li>
    <li><span class="function"><a href="function.mysql-client-encoding.php" class="function" rel="rdfs-seeAlso">mysql_client_encoding()</a> - Returns the name of the character set</span></li>
   </ul>
  </p>
 </div>


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