What is mysql client encoding in PHP

In this article I am going to explain about mysql_client_encoding function in PHP.
  • 1797

PHP mysql_client_encoding() Function

The PHP mysql_client_encoding function returns the name of character set for the current connection.

Syntax of mysql_client_encoding function

mysql_client_encoding(connection)


Parameters in
mysql_client_encoding function

It has only one parameter:
 

Parameter Description
connection It specifies mysql connection.

Example of mysql_client_encoding function

<html>

<body>

<?php

$con=mysql_connect("localhost","gupta","sharad");

if(!$con)

{

die("Could not connect:". mysql_error());

}

$charset= mysql_client_encoding($con);

echo "The current character set is: $charset";

mysql_close($con);

?>

</body>

</html>


Output:

mysql-client-encoding-php.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.