PHP Velho Oeste 2025

mysql_set_charset

(PHP 5 >= 5.2.3)

mysql_set_charsetSets the client character set

Avviso

Questa enstensione deprecata da PHP 5.5.0, e sarà rimossa in futuro. Al suo posto, usare l'estensione MySQLi o PDO_MySQL. Vedere anche la guida MySQL: scelta dell'API e le FAQ relative per ulteriori informazioni. Le alternative a questa funzione includono:

Descrizione

mysql_set_charset(string $charset, resource $link_identifier = NULL): bool

Sets the default character set for the current connection.

Elenco dei parametri

charset

A valid character set name.

link_identifier

La connessione MySQL. Se l'identificativo di connessione non è specificato, l'ultima connessione aperta da mysql_connect() viene assunta. Se questa connessione non è trovata, si cercherà di crearne una come se mysql_connect() fosse stata chiamata senza argomenti. Se una connessione non è trovata oppure non viene stabilita, un avviso di livello E_WARNING viene generato.

Valori restituiti

Restituisce true in caso di successo, false in caso di fallimento.

Note

Nota:

This function requires MySQL 5.0.7 or later.

Nota:

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.

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top