You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$config = new \Spot\Config();
$config->addConnection('fromString', 'mysql://user:password@localhost/database?charset=utf8mb4');
//check the collation to see if it workedecho$cfg->connection('fromString')->query("SELECT COLLATION('foo') AS charset;")->fetchColumn();
//outputs "utf8mb4_general_ci"
To be perfectly honest, that's not actually how I do it. I prefer the array-syntax:
$config = new \Spot\Config();
$config->addConnection('fromArray', [
'dbname' => 'database',
'user' => 'user',
'password' => 'password',
'host' => 'localhost',
'driver' => 'pdo_mysql',
'charset' => 'utf8mb4'
]);
//check the collation to see if it workedecho$cfg->connection('fromArray')->query("SELECT COLLATION('foo') AS charset;")->fetchColumn();
//outputs "utf8mb4_general_ci"
found nothing config charset
The text was updated successfully, but these errors were encountered: