PHP mysql_client_encoding() Function Example

PHP mysql_client_encoding() Function Example


Posted in : PHP Posted on : February 5, 2011 at 5:47 PM Comments : [ 0 ]

The mysql_client_encoding() function is used to find the default character set name for the current connection.

PHP mysql_client_encoding() Function Example:

The mysql_client_encoding() function is used to find the default character set name for the current connection.

Example:

<?php
$connection = mysql_connect("localhost","root","root");

if (!$connection) {
die('PHP Mysql database connection could not connect : ' . mysql_error());
}
else{ 
$charactor_set = mysql_client_encoding($connection);
echo "The current character set is: $charactor_set\n";
}
mysql_close($connection); 
?> 

After running this example the output is:

Output:

The current character set is: latin1

Download Example Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics