PHPackages                             4d47/pdo2 - 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. 4d47/pdo2

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

4d47/pdo2
=========

PDO supplements

1.0.0(12y ago)090PHPPHP &gt;=5.3.0

Since Nov 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/4d47/pdo2)[ Packagist](https://packagist.org/packages/4d47/pdo2)[ RSS](/packages/4d47-pdo2/feed)WikiDiscussions master Synced 2w ago

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

PDO2
====

[](#pdo2)

Lightweight (5.6KB) [PDO](http://php.net/pdo) wrapper to accelerate database development.

Usage
-----

[](#usage)

```
$db = new PDO2($yourPdoInstance)
```

All PDO methods are still available directly, but the instance is augmented with six extra methods.

1. **execute**(string $statement, array $input\_parameters = \[\]) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)

    ```
    $stm = $db->execute("SELECT * FROM wat WHERE id = ?", [12]);
    // shortcut of
    $stm = $this->prepare("SELECT * FROM wat WHERE id = ?");
    $stm->execute([12]);
    ```
2. **select**($table, $params = \[\], $extra = '', $values = \[\]) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)

    ```
    $db->select('actors');
    $db->select('actors', ['first_name' => 'Al']);
    $db->select('actors', ['age > ?' => 52]);
    $db->select('id,age,name from actors', ['age > ?' => 52]);
    // Associative array creates AND, list array creates OR.
    $db->select('actors', ['a' => 1, [['b' => 2], ['c' => 3]]])
    // SELECT * FROM actors WHERE a = ? AND ((b = ?) OR (c = ?))
    ```
3. **insert**($table, array $params) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)

    ```
    $db->insert('actors', ['first_name' => 'Humphrey', 'last_name' => 'Bogart', 'age' => 57]);
    ```
4. **update**($table, array $params, array $where) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)

    ```
    $db->update('actors', ['first_name' => 'Tommy'], ['id' => 3])
    ```
5. **delete**($table, array $params) : [PDOStatement](http://php.net/manual/en/class.pdostatement.php)

    ```
    $db->delete('actors', ['id' => 3]);
    $db->delete('actors', []); // empty where part cannot be omitted.
    ```
6. **count**($table, array $params = null) : int

    ```
    $db->count('actors', ['first_name' => 'Tom'])
    ```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

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

4598d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c1f7f19402246b0c27cb6428889b9d44a9f11018d3d2dc8734cfd8757af7dd3?d=identicon)[4d47](/maintainers/4d47)

---

Top Contributors

[![4d47](https://avatars.githubusercontent.com/u/729919?v=4)](https://github.com/4d47 "4d47 (9 commits)")

---

Tags

databasephpwrapper

### Embed Badge

![Health badge](/badges/4d47-pdo2/health.svg)

```
[![Health](https://phpackages.com/badges/4d47-pdo2/health.svg)](https://phpackages.com/packages/4d47-pdo2)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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