An open API service indexing awesome lists of open source software.

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.

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
]);
```