mysql_set_charset

(PHP 5 >= 5.2.3)

mysql_set_charset — Sets the client character set

Avviso

Questa estensione è stata deprecata in PHP 5.5.0 ed è stata rimossa in PHP 7.0.0. Al suo posto, si dovrebbe usare l'estensione MySQLi o PDO_MySQL. Vedere anche la guida MySQL: scelta dell'API. Le alternative a questa funzione includono:

Descrizione

function 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, viene usata l'ultima connessione aperta da mysql_connect(). Se tale connessione non viene trovata, si cercherà di crearne una come se mysql_connect() fosse stata chiamata senza argomenti. Se nessuna connessione viene trovata o stabilita, viene generato un errore di livello E_WARNING.

Valori restituiti

Restituisce true in caso di successo o 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.

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top