PHPackages                             daydiff/simple-db - 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. daydiff/simple-db

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

daydiff/simple-db
=================

A simple database class using PDO under the hood

v1.0.0(9y ago)017MITPHPPHP &gt;=5.4.0

Since Jul 26Pushed 9y agoCompare

[ Source](https://github.com/daydiff/simple_db)[ Packagist](https://packagist.org/packages/daydiff/simple-db)[ Docs](https://github.com/daydiff/simple_db)[ RSS](/packages/daydiff-simple-db/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

A simple Db class - a high level wrapper on PDO
===============================================

[](#a-simple-db-class---a-high-level-wrapper-on-pdo)

[![Latest Version on Packagist](https://camo.githubusercontent.com/98ac2164599eb1217da2087d9a4d880d02e0ad0a65ab250f408f74b9321c57d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646179646966662f73696d706c652d64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/daydiff/simple-db)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/633241e0d50465f633fb602cfee2677119a0aa2678b424380a720c6570219a1a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f646179646966662f73696d706c655f64622f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/daydiff/simple_db)

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
-------

[](#install)

Recommended way

```
$ composer require daydiff/simple-db
```

Alternate way

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

Usage
-----

[](#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
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3580d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/13a56a262b99068cf1e67dfff1ac9024c82dbeb737dad6035e09d9b0bf2c6875?d=identicon)[Daydiff](/maintainers/Daydiff)

---

Top Contributors

[![daydiff](https://avatars.githubusercontent.com/u/2212845?v=4)](https://github.com/daydiff "daydiff (25 commits)")

---

Tags

databasedaydiff

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/daydiff-simple-db/health.svg)

```
[![Health](https://phpackages.com/badges/daydiff-simple-db/health.svg)](https://phpackages.com/packages/daydiff-simple-db)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k241.3M3.3k](/packages/doctrine-doctrine-bundle)[doctrine/migrations

PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

4.8k204.8M440](/packages/doctrine-migrations)[doctrine/data-fixtures

Data Fixtures for all Doctrine Object Managers

2.9k136.1M516](/packages/doctrine-data-fixtures)[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
