PHPackages                             adamb/database - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. adamb/database

ActiveLibrary[Database &amp; ORM](/categories/database)

adamb/database
==============

A simple PDO Wrapper to connect to a database

1.6.4(1y ago)187.6k519MITPHP

Since Jul 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/adambinnersley/pdo-dbal)[ Packagist](https://packagist.org/packages/adamb/database)[ Docs](https://github.com/AdamB7586/pdo-dbal)[ RSS](/packages/adamb-database/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (6)Used By (19)

[![Build Status](https://camo.githubusercontent.com/cf3623c40bfa422997cb3df3d241918b1866eec12ef95a4b5aaaa0ffaa46c729/68747470733a2f2f6170692e7472617669732d63692e6f72672f4164616d42373538362f70646f2d6462616c2e706e67)](https://api.travis-ci.org/AdamB7586/pdo-dbal)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/607803661466b29dc31fd8573d46b6ebba7bb2d3ab82285627f4fa65b816a53c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4164616d42373538362f70646f2d6462616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/AdamB7586/pdo-dbal/)[![Minimum PHP Version](https://camo.githubusercontent.com/a61767cd5fad846f5fe320af243fc4d50528ac3f32372bca131f3f5589b46d77/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d636972636c65)](https://php.net/)[![Scrutinizer Coverage](https://camo.githubusercontent.com/6c9d4e7a90f65a0494474a1811f571662f792fb2b5a4ee6b80d5a5b71e02187b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4164616d42373538362f70646f2d6462616c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/AdamB7586/pdo-dbal/)

PDO Database Abstraction Layer
==============================

[](#pdo-database-abstraction-layer)

A simple database abstraction layer for MySQL PDO

Installation
------------

[](#installation)

Installation is available via [Composer/Packagist](https://packagist.org/packages/adamb/database), you can add the following line to your `composer.json` file:

```
"adamb/database": "^1.0"
```

or

```
composer require adamb/database
```

Class Features
--------------

[](#class-features)

- Optional cache support with Memcache / Memcached / Redis / XCache
- Optional connection to secondary database incase the no connection to the primary MySQL server is available
- Connects to a MySQL database via PDO
- Simplify queries to SELECT / INSERT / UPDATE and DELETE
- Built in prepared statements
- Compatible with PHP5.6 and later

License
-------

[](#license)

This software is distributed under the [MIT](https://github.com/AdamB7586/pdo-dbal/blob/master/LICENSE) license. Please read LICENSE for information on the software availability and distribution.

Usage
-----

[](#usage)

Example of usage can be found below with what queries they would result in (For security all queries are run using prepared statements with values added on execute() after the prepare() has been run)

### 1. Connect

[](#1-connect)

```
