laravel Mysql希腊字母显示如何?

时间:2016-06-04 09:14:10

标签: php mysql laravel

Mysql表 日志校对是latin1_swedish_ci

app.blade

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

这是我的控制器

        $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); 

我尝试从模型中获取查询但没有运气 在mysql数据库中存储像这样的

??????????????????????

在我的旧PHP代码(没有laravel)mysqli一切正常与GREEK charackters

1 个答案:

答案 0 :(得分:1)

我将MySQL表格字段从Collation更改为utf8_unicode_ci

utf8_unicode_ci