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

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

reptily/db
==========

DB interface for MySQL

1.0.1(6y ago)15MITPHP

Since Sep 23Pushed 6y agoCompare

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

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

phpDB
=====

[](#phpdb)

convenient library to work with mysql for php

Install for composer
--------------------

[](#install-for-composer)

```
composer require reptily/db

```

Initialization module
---------------------

[](#initialization-module)

```
require "./vendor/autoload.php";

$config = [
        "host" => "localhost",
        "login" => "root",
        "pwd" => "*******",
        "db" => "php_db_test"
        ];

$DB = new \openWeb\DB($config);
```

Create table

```
$table = [
                "id" =>[
                        "type"=>"int",
                        "count"=>11,
                        "isNull"=>false,
                        "autoIncrement"=>true
                ],
                "name"=>[]
        ];
$DB->Create("account",$table);
```

Insert value

```
$DB->account->Insert(["name"=>"user"]);
```

Select all rows and output to array

```
$row=$DB->account->Select()->getArray();
print_r($row);
```

Select all rows and output to json string

```
echo $DB->account->Select()->getJson();
```

Select table account only id colum

```
echo $DB->account->where(["id" => 1])->Select()->getJson();
```

Select table account only id colum

```
echo $DB->account->field(["id"])->Select()->getJson();
```

Select table account and where id = 1 and id = 3

```
echo $DB->account->where('or',["id" => 1],["id" => 3])->Select()->getJson();
```

Select table account only id colum and where id = 1

```
echo $DB->account->field(["name"])->where(["id" => 1])->Select()->getJson();
```

Select table account id and name colum and where id = 1

```
echo $DB->account->field(["id","name"])->where(["id" => 1])->Select()->getJson();
```

Select table account where id more 1

```
echo $DB->account->where("id > 1")->Select()->getJson();
```

Inner table blog

```
echo $DB->account->inner("blog")->on("id","id")->Select()->getJson();
```

Left table blog

```
echo $DB->account->left("blog")->on("id","id")->Select()->getJson();
```

Update values in table blog

```
$DB->blog->set(['name' => 'update'])->where(["id" => 2])->Update();
```

Delete values in table account

```
$DB->account->where(["id" => 1])->Delete()
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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

2426d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63a84b9b680bd78e5ce9e59937330e49e20c065b6d147ba2b0f246087a66aa7f?d=identicon)[reptily](/maintainers/reptily)

---

Top Contributors

[![reptily](https://avatars.githubusercontent.com/u/47777868?v=4)](https://github.com/reptily "reptily (12 commits)")

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

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

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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