daydiff / simple_db

A simple Db class - a high level wrapper on PDO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A simple Db class - a high level wrapper on PDO

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.

About

A simple Db class - a high level wrapper on PDO

License:MIT License


Languages

Language:PHP 100.0%