Goran Siriev Goran Siriev - 2 years ago 118
PHP Question

laravel Mysql Greek letters showing like?

Mysql table
logs Collation is latin1_swedish_ci


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

This is my Controller

$PDO = DB::connection('mysql')->getPdo();
//$PDO->exec("SET CHARACTER SET 'utf8'"); // i try this Not working ...

$billingStmt = $PDO->prepare("select * from logs");
$usersBills = $billingStmt->fetchAll((\PDO::FETCH_ASSOC));
//header('Content-Type: text/html; charset=utf-8'); // i try this Not working ...
$logs = ($usersBills);

I try to get query from model but no luck
in mysql database characters store like this


In my old php code (No laravel) mysqli everything working fine with GREEK charackters

Answer Source

I changed my MySQL table field from Collation to utf8_unicode_ci


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download