This commit is contained in:
2018-10-17 11:14:36 +03:00
parent 75a35947e5
commit 04d60d7e2c
2716 changed files with 431449 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
/**
* Created by PhpStorm.
* User: andrey
* Date: 14.04.16
* Time: 18:33
*/
class Db{
public static function getConnection(){
$paramsPath = ROOT.'/config/db_params.php';
$params = include($paramsPath);
$dsn = "mysql:host={$params['host']};dbname={$params['dbname']}";
$db = new PDO($dsn, $params['user'], $params['password']);
$db->exec('SET NAMES utf8'); //задаём кодировку ввода/вывода БД
return $db;
}
}
?>