Skip to content
This repository was archived by the owner on Nov 26, 2022. It is now read-only.

Commit 2ddc3d3

Browse files
authored
Update README.md
1 parent a0c2a5d commit 2ddc3d3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ composer require odan/database
3131
## Usage
3232

3333
```php
34+
require_once 'vendor/autoload.php';
35+
36+
37+
$dsn = "mysql:host=127.0.0.1;dbname=test;charset=utf8";
38+
$username = 'root';
39+
$password = '';
40+
41+
$options = [
42+
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
43+
PDO::ATTR_PERSISTENT => false,
44+
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
45+
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8 COLLATE utf8_unicode_ci"
46+
];
47+
3448
$db = new \Odan\Database\Connection($dsn, $username, $password, $options);
3549

3650
$users = $db->select()

0 commit comments

Comments
 (0)