PHPackages                             mtchabok/database - 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. mtchabok/database

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

mtchabok/database
=================

PHP PDO Database Class for handling Databases

v0.1.0(6y ago)02MITPHPPHP &gt;=7.0

Since Mar 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mtchabok/database)[ Packagist](https://packagist.org/packages/mtchabok/database)[ RSS](/packages/mtchabok-database/feed)WikiDiscussions v0.1.0 Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PHP PDO Database Control
========================

[](#php-pdo-database-control)

PHP PDO Database Class for handling Databases.

- unlimited managment connection to databases
- objective query control
- fast execute query
- php pdo support
- support add/edit variable`s in queries
- subqueries supported
- pdo (mysql, sqlsrv) support
- auto generate query
- database/table/field name control

Installation
------------

[](#installation)

This package is listed on [Packagist](https://packagist.org/packages/mtchabok/database).

```
composer require mtchabok/database

```

How To Usage
------------

[](#how-to-usage)

#### Create Connection Object

[](#create-connection-object)

```
use \Mtchabok\Database\Connection;

$connection = new Connection('mysql:host=localhost;dbname=test;charset=utf8', 'root','');

$connection = Connection::newConnection('mysql:host=localhost;dbname=test;charset=utf8', 'root','');

$connection = (new Connection())
	->setDriver(Connection::DRIVER_MYSQL)
	->setServer('localhost')
	->setDatabase('test')
	->setUser('root')
	->setPass('')
	->setCharset(Connection::CHARSET_UTF8)
;

class my_connection extends Connection
{
	protected $_driver = Connection::DRIVER_MYSQL;
	protected $_server = 'localhost';
	protected $_database = 'test';
	protected $_user = 'root';
	protected $_charset = Connection::CHARSET_UTF8;
}
$connection = new my_connection();

$connection = new Connection\Mysql();
$connection->setDatabase('test');
```

#### Create Select/Insert/Update/Delete Query Object

[](#create-selectinsertupdatedelete-query-object)

```
use Mtchabok\Database\Select;
use Mtchabok\Database\Insert;
use Mtchabok\Database\Update;
use Mtchabok\Database\Delete;

$qSelect = $connection->newSelect('person');
$qInsert = $connection->newInsert('person');
$qUpdate = $connection->newUpdate('person');
$qDelete = $connection->newDelete('person');

$qSelect = (new Select('person'))->setConnection($connection);
$qInsert = (new Insert('person'))->setConnection($connection);
$qUpdate = (new Update('person'))->setConnection($connection);
$qDelete = (new Delete('person'))->setConnection($connection);

$qSelect = (Select::newSelect('person'))->setConnection($connection);
```

#### Execute Query

[](#execute-query)

```
$qSelect->setField(['id', 'name', 'mobile'])
	->addWhere('%mohammad%', 'LIKE', 'name')
	->setOrderBy('id', 'DESC')
;
$result = $qSelect->fetchAllObject(); // return array of objects
```

#### For More Usage Documentation, Use This Database Package By IDE

[](#for-more-usage-documentation-use-this-database-package-by-ide)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

Every ~281 days

Total

2

Last Release

1972d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4ffa7dd709b65d7cb654af598deedb150bbf8075c70a6bdce2ddc4e3d278c644?d=identicon)[mtchabok](/maintainers/mtchabok)

---

Top Contributors

[![mtchabok](https://avatars.githubusercontent.com/u/27890892?v=4)](https://github.com/mtchabok "mtchabok (3 commits)")

---

Tags

databasedatabase-managementpdo databasePHP PDO Database

### Embed Badge

![Health badge](/badges/mtchabok-database/health.svg)

```
[![Health](https://phpackages.com/badges/mtchabok-database/health.svg)](https://phpackages.com/packages/mtchabok-database)
```

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