Goran Siriev Goran Siriev - 6 months ago 17
PHP Question

laravel Mysql Greek letters showing like?

Mysql table
logs Collation is latin1_swedish_ci

app.blade

<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");
$billingStmt->execute();
$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

I changed my MySQL table field from Collation to utf8_unicode_ci

utf8_unicode_ci