User97798 User97798 - 1 year ago 85
MySQL Question

Unable to fetch characters as in Mysql database

Unable to fetch characters as in MySql database below is the table.

| APH | ID0 |
| A | Costa Rican Colón |
| B | Icelandic Króna |
| C | Somali Shilling |
| D | Nicaraguan Córdoba |

when i get the from db by using PDO in php
then the above character shown like this

Costa Rican Col�n

what should i do?

Answer Source

After fetching from mysql you need to use htmlentities like below in PHP

$str = htmlentities('Costa Rican Colón');
echo $str;exit;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download