https://github.com/arabcoders/db
Extends PDO to add extra methods.
https://github.com/arabcoders/db
Last synced: 5 months ago
JSON representation
Extends PDO to add extra methods.
- Host: GitHub
- URL: https://github.com/arabcoders/db
- Owner: arabcoders
- License: mit
- Created: 2016-06-25T18:27:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-02-25T12:40:39.000Z (over 7 years ago)
- Last Synced: 2025-05-03T21:03:52.047Z (about 1 year ago)
- Language: PHP
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PDO Extender
This package extends PDO to implement extra method to ease the use of prepared statements,
and add shortcut methods for update/delete/insert/select.
## Install
Via Composer
```bash
$ composer require arabcoders/db
```
## Usage Example.
```php
insert( 'tableName',[
'id' => 1,
'name' => 'foo'
]);
//-- get last insert id.
$id = $db->id();
// -- update row.
$update = $db->update( 'tableName',
[
'name' => 'bar'
],[
'id' => $id
]
);
$delete = $db->delete( 'tableName', [
'id' => $id
]);
```