Table of Contents

Syntax

string mysql_client_encoding([resource $res])

(PHP 4 ⇒ 4.3.0, PHP 5)

$res The database connection resource that we want to modify.
RETURNS The name of the character set encoding used by the MySQL database.

What it Does

This function returns the name of the character set encoding used by the MySQL database server. Make sure you have established a connection to the database using mysql_connect before calling this function.

Example

// open the mysql resource
$res = mysql_connect($server, $user, $pass);
 
// retrieve the mysql character encoding
$charset = mysql_client_encoding($res);
echo 'MySQL charset is ' . $charset;
 
mysql_client_encoding.txt · Last modified: Apr 18, 2008 - 2:00pm (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki