Am trying to insert korean characters to mysql leveraging PHP Pdo and mysql. When I insert charcater 다시 말해 주세요 it shows ?? ?? ??? inside mysql database
Here is how I created table
create table base_tab (id int primary key auto_increment, content text, username varchar(20)) CHARACTER SET utf8 COLLATE utf8_unicode_ci;
here is the code
$db = new PDO ('mysql:host=localhost;dbname=mydb_test;charset=utf8',
'root', // username
''// password
);
$timer = time();
$statement = $db->prepare('INSERT INTO base_tab
(content,username)
values
(:content,:username)');
$statement->execute(array(
':content' => '다시 말해 주세요',
':username' => 'ann'
));
if($statement){
echo "success";
}else{
echo "failed";
}