mysql connection related to EUR € symbol using PHP

"€" can not be recognized by ISO-8859-1 standard as it is encoded by UTF-8.
By default, mysql connection using ISO-8859-1 based connection, and will turn "€" as "â" using mysql query.   In order to get a correct "€", then mysql connection should be like this:

$conn = mysql_connect($host.':'.$port, $username, $password);
mysql_set_charset("utf8");
$query = "select ...";
$db= mysql_select_db($database, $conn);
$result = mysql_query($query);

Comments

Popular posts from this blog

install postgreSQL in ubuntu 16.04

timestamp with 16, 13 and 10 digits to Qlik date

install ipython in Cloudera VM using pip