Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Db {
- public static function getConnection() {
- $host = 'localhost';
- $dbname = 'DataBase';
- $user = 'root';
- $password = 'Passwword';
- $charsetByDefault = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
- $db = new PDO("mysql:host=$host;dbname=$dbname", $user, $password, $charsetByDefault);
- return $db;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement