@@ -22,23 +22,22 @@ Here a few things to keep in mind:
22
22
### Initialization
23
23
24
24
``` 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]);
27
26
```
28
27
29
28
``` PHP
30
29
$mysql = new MySQL($pdo);
31
- $mysql->getAliasRegistry()->add('textprefix ', 'testdb.test__');
30
+ $mysql->getAliasRegistry()->add('t ', 'testdb.test__');
32
31
```
33
32
34
33
### Select
35
34
36
35
``` PHP
37
36
$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')
42
41
->orderBy('t1.field1')
43
42
->orderBy('t1.field2', 'DESC')
44
43
->limit(100)
0 commit comments