timezona
юзера. Не думаю что для одного поля выгодно делать таблицу) 'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;port=8889;dbname=mydbname;unix_socket=/Applications/MAMP/tmp/mysql/mysql.sock',
'username' => 'myuser',
'password' => 'mypassword',
'charset' => 'utf8',
],
<?php
try {
$dbh = new PDO('mysql:host=localhost;dbname=base007', 'root', 'root');
foreach($dbh->query('SELECT * from FOO') as $row) {
print_r($row);
}
$dbh = null;
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
/common/config/main-local.php
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=base007',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
],
],
];