1
1
# php-database
2
- A PHP library for accessing databases easily. The library provide a MySQL/MariaDB falavoured database object
3
- that abstracts many daily task in SQL writing, such as quoting, escaping, building SQL statement , WHERE
2
+ A PHP library for accessing databases easily. The library provide a MySQL/MariaDB flavoured database object
3
+ that abstracts many daily task in SQL writing, such as quoting, escaping, building SQL statements , WHERE
4
4
clauses, error handling and so on.
5
5
6
- A Data Access Object (DAO) base class is also provided to cater for object-relational mapping tasks. The
7
- interface will make it easier to find objects by ID, create and update them, using special data objects
8
- of your own.
6
+ A [ Data Access Object (DAO)] ( #how-to-use-a-database-access-object-dao ) base class is also provided to
7
+ cater for object-relational mapping tasks. The interface will make it easier to find objects by ID, create and update
8
+ them, using special data objects of your own.
9
9
10
- Finally, a Query API is provided to support a flexible writing of restrictions - independant of any SQL dialect.
10
+ Finally, a [ Query API] ( #query-api ) is provided to support a flexible writing of restrictions - independant of any SQL dialect.
11
11
12
12
# License
13
13
This project is licensed under [ GNU LGPL 3.0] ( LICENSE.md ) .
@@ -123,6 +123,9 @@ And finally you can delete objects. You will need the table name and the WHERE c
123
123
$db->delete('#__devtest', 'uid='.$uid);
124
124
```
125
125
126
+ ** Remark:** ` update() ` , ` updateSingle() ` and ` delete() ` now support the new [ Query API] ( #query-api ) for the
127
+ WHERE condition.
128
+
126
129
# How to use a Database Access Object (DAO)
127
130
128
131
The low-level ` Database ` abstraction makes object-relational mappings already simple. However,
@@ -170,7 +173,7 @@ $users = $dao->find(array('group' => 'admin', 'active' => 1), array('name', 'ema
170
173
```
171
174
172
175
** Attention:** This way of describing restrictions is deprecated as of v1.3. ` find() ` and ` findSingle() ` now support
173
- the new Query API. Please read the [ QueryAPI ] (# Query API) chapter.
176
+ the new Query API. Please read the [ Query API] ( #query-api ) chapter.
174
177
175
178
## Creating, Saving and Deleting objects
176
179
@@ -229,7 +232,7 @@ $users = $dao->find(array(
229
232
));
230
233
```
231
234
** Attention:** This way of describing restrictions is deprecated as of v1.3. ` find() ` and ` findSingle() ` now support
232
- the new Query API. Please read the [ QueryAPI ] (# Query API) chapter.
235
+ the new Query API. Please read the [ Query API] ( #query-api ) chapter.
233
236
234
237
## ORDER clauses in DAO interface
235
238
@@ -250,7 +253,7 @@ $users = $dao->find('', array('name DESC', 'email ASC'));
250
253
Default order sequence is ascending (` ASC ` ) if not specified.
251
254
252
255
** Attention:** This way of describing ordering is deprecated as of v1.3. ` find() ` and ` findSingle() ` now support
253
- the new Query API. Please read the [ QueryAPI ] (# Query API) chapter.
256
+ the new Query API. Please read the [ Query API] ( #query-api ) chapter.
254
257
255
258
## Extending DAO
256
259
@@ -275,7 +278,7 @@ class Users extends DAO {
275
278
```
276
279
277
280
** Attention:** This way of describing restrictions is deprecated as of v1.3. ` find() ` and ` findSingle() ` now support
278
- the new Query API. Please read the [ QueryAPI ] (# Query API) chapter.
281
+ the new Query API. Please read the [ Query API] ( #query-api ) chapter.
279
282
280
283
## Using Data Objects with DAOs
281
284
0 commit comments