daydiff/simple-db

A simple database class using PDO under the hood

v1.0.0 2016-07-26 05:45 UTC

This package is not auto-updated.

Last update: 2024-11-09 19:45:43 UTC


README

Latest Version on Packagist Software License Build Status

It's a very simple but handy and high level database wrapper on PDO. Usefull for small scripts and for systems without "normal" database abstraction.

Install

Recommended way

$ composer require daydiff/simple-db

Alternate way

$ git clone https://github.com/daydiff/simple_db

Usage

It's very simple like a class itself

use Daydiff\SimpleDb\Db;

$dsn = 'mysql:dbname=great_company;host=localhost';
$user = 'database_user';
$password = 'database_password';

$db = new Db($dsn, $user, $password);
$name = $db->scalar('SELECT name FROM user WHERE id = :id', [':id' => 1]);

License

The MIT License (MIT). Please see License File for more information.