daydiff / simple-db
A simple database class using PDO under the hood
v1.0.0
2016-07-26 05:45 UTC
Requires
- php: >=5.4.0
- ext-pdo: *
Requires (Dev)
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-11-09 19:45:43 UTC
README
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.