From d94243f19dbc6b710f0b941ce249e37db00363ed Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 15 Sep 2016 23:51:29 +0200 Subject: [PATCH] Update examples of how to provide a database connection --- README.md | 3 ++- tests/index.php | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d909ed6..06aacc2 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,8 @@ Completely framework-agnostic and database-agnostic. ```php // $db = new PDO('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password'); -// $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +// or +// $db = new \Delight\Db\PdoDsn('mysql:dbname=my-database;host=localhost;charset=utf8mb4', 'my-username', 'my-password'); $auth = new \Delight\Auth\Auth($db); ``` diff --git a/tests/index.php b/tests/index.php index 4c22c00..b7dcccd 100644 --- a/tests/index.php +++ b/tests/index.php @@ -20,7 +20,6 @@ header('Content-type: text/html; charset=utf-8'); require __DIR__.'/../vendor/autoload.php'; $db = new PDO('mysql:dbname=php_auth;host=127.0.0.1;charset=utf8mb4', 'root', ''); -$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $auth = new \Delight\Auth\Auth($db);