MySQL Funciones
PHP Manual

mysql_set_charset

(PHP 5 >= 5.2.3)

mysql_set_charsetSets the client character set

Descripción

bool mysql_set_charset ( string $charset [, resource $link_identifier ] )

Sets the default character set for the current connection.

Parámetros

charset

A valid character set name.

link_identifier

La conexión MySQL. Si el identificador de enlace no se especifica, el último enlace abierto por mysql_connect() es asumido. Si no se encuentra dicho enlace, la función intentará establecer un nuevo enlace como si mysql_connect() fuese invocado sin parámetros. Si no se encuentra o establece una conexión, un error de nivel E_WARNING es generado.

Valores devueltos

Devuelve TRUE en caso de éxito o FALSE en caso de error.

Notas

Note:

This function requires MySQL 5.0.7 or later.

Note:

This is the preferred way to change the charset. Using mysql_query() to execute SET NAMES .. is not recommended.

Ver también


MySQL Funciones
PHP Manual