Skip to content

Commit ff3c94c

Browse files
committed
Update README.md
1 parent 7e87e01 commit ff3c94c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,22 @@ Here a few things to keep in mind:
2222
### Initialization
2323

2424
```PHP
25-
$pdo = new PDO('mysql:host=127.0.0.1;dbname=test;charset=utf8', 'root', '');
26-
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
25+
$pdo = new PDO('mysql:host=127.0.0.1;dbname=test;charset=utf8', 'root', '', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
2726
```
2827

2928
```PHP
3029
$mysql = new MySQL($pdo);
31-
$mysql->getAliasRegistry()->add('textprefix', 'testdb.test__');
30+
$mysql->getAliasRegistry()->add('t', 'testdb.test__');
3231
```
3332

3433
### Select
3534

3635
```PHP
3736
$select = $mysql->select(['customer_count' => 'COUNT(*)'])
38-
->from('t1', 'textprefix#test1') // You are forced to used aliases for tables.
39-
->joinInner('t2', 'textprefix#test2', 't2.test_id = t1.id AND t2.field1 = ?', 123)
40-
->joinLeft('t3', 'textprefix#test3', 't3.test_id = t1.id')
41-
->joinRight('t4', 'textprefix#test4', 't4.test_id = t1.id')
37+
->from('t1', 't#test1') // You are forced to used aliases for tables.
38+
->joinInner('t2', 't#test2', 't2.test_id = t1.id AND t2.field1 = ?', 123)
39+
->joinLeft('t3', 't#test3', 't3.test_id = t1.id')
40+
->joinRight('t4', 't#test4', 't4.test_id = t1.id')
4241
->orderBy('t1.field1')
4342
->orderBy('t1.field2', 'DESC')
4443
->limit(100)

0 commit comments

Comments
 (0)