izniburak / pdox

useful query builder class that works with PHP PDO class for simple access your data.
http://burakdemirtas.org/pdox-kullanisli-pdo-sinifi-php/
MIT License
292 stars 108 forks source link

sqlite don't support "SET NAMES utf8" statement #111

Open yangqingrong opened 4 weeks ago

yangqingrong commented 4 weeks ago
try {
            $this->pdo = new PDO($dsn, $config['username'], $config['password']);
            //I add this block to avoid exception
            if( !in_array($config['driver'],['sqlite'])){
                $this->pdo->exec("SET NAMES '" . $config['charset'] . "' COLLATE '" . $config['collation'] . "'");
                $this->pdo->exec("SET CHARACTER SET '" . $config['charset'] . "'");
            }
           // ...
izniburak commented 3 weeks ago

Thanks for the issue. I'll check it and plan to release new version that contain related fixes.