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); ?>
(PHP 5 >= 5.2.3)
mysql_set_charset — Sets the client character set
Це розширення застаріле, починаючи з PHP 5.5.0, та вилучене з PHP 7.0.0. Натомість використовуються розширення MySQLi або PDO_MySQL. Докладніше описано у керівництві MySQL: вибір API. Цю функцію можна замінити на:
charset to the connection string, such as charset=utf8Sets the default character set for the current connection.
charsetA valid character set name.
link_identifierЗ'єднання
MySQL. Якщо не задано, буде обрано останнє з'єднання, встановлене функцією
mysql_connect(). Якщо з'єднатися не вдалось, функція
спробує встановити нове, ніби викликавши функцію
mysql_connect() без параметрів. Якщо з'єднання не
вдалося знайти або встановити, буде виведено повідомлення рівня
E_WARNING
Зауваження:
This function requires MySQL 5.0.7 or later.
Зауваження:
This is the preferred way to change the charset. Using mysql_query() to set it (such as
SET NAMES utf8) is not recommended. See the MySQL character set concepts section for more information.