PHP Classes


Recommend this page to a friend!
  Classes of Unay Santisteban   Database PDO Abstract Layer   Download  
Role: Documentation
Content type: text/markdown
Description: Readme
Class: Database PDO Abstract Layer
Run queries with PDO and get results in XML, JSON
Author: By
Last change: Update of
Date: 1 month ago
Size: 1,343 bytes


Class file image Download

OtherCode Database

Build Status Latest Stable Version License Total Downloads

Light database abstraction layer (PDO)

Currently supported:

  • MySQL
  • SQLite
  • Postgres


To install the package we only have to add the dependency to *composer.json* file:

"require": {
  "othercode/database": "*"

And run the following command:

composer update

Install without Composer

Also we can use this library without Composer, we only have to include in our script the "database/autoload.php" file.

require_once "database/autoload.php".


Now we have to create the instance and add a new connection to it.

$db = new OtherCode\Database\Database();

    'driver' => 'mysql',
    'host' => 'localhost',
    'dbname' => 'test',
    'username' => 'username',
    'password' => 'password'