Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://php.net/manual/en/function.mysql-set-charset.php" rel="noreferrer"><code>mysql_set_charset()</code></a> would be an option - but an option limited to the <a href="http://www.php.net/manual/en/book.mysql.php" rel="noreferrer"><code>ext/mysql</code></a>. For <a href="http://www.php.net/manual/en/book.mysqli.php" rel="noreferrer"><code>ext/mysqli</code></a> it is <a href="http://php.net/manual/mysqli.set-charset.php" rel="noreferrer"><code>mysqli_set_charset</code></a> and for <a href="http://www.php.net/manual/en/book.pdo.php" rel="noreferrer"><code>PDO</code></a><code>::mysql</code> you need to specify a connection parameter.</p> <p>As using this function results in a MySQL API call, it should be considered much faster than issuing a query.</p> <p>In respect of performance the fastest way to ensure a UTF-8-based communiction between your script and the MySQL server is setting up the MySQL server correctly. As <code>SET NAMES x</code> is <a href="http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html" rel="noreferrer">equivalent</a> to </p> <pre><code>SET character_set_client = x; SET character_set_results = x; SET character_set_connection = x; </code></pre> <p>whereas <code>SET character_set_connection = x</code> internally also executes <code>SET collation_connection = &lt;&lt;default_collation_of_character_set_x&gt;&gt;</code> you can also set <a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html" rel="noreferrer">these server variables</a> statically in your <code>my.ini/cnf</code>.</p> <p>Please be aware of possible problems with other applications running on the same MySQL server instance and requiring some other character set.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload