PHPackages                             faapz/pdo - 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. faapz/pdo

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

faapz/pdo
=========

Just another PDO database library

v2.2.3(1y ago)314135.1k↓14.4%100[3 PRs](https://github.com/FaaPz/PDO/pulls)4MITPHPPHP &gt;=7.2.0

Since Jul 25Pushed 1y ago22 watchersCompare

[ Source](https://github.com/FaaPz/PDO)[ Packagist](https://packagist.org/packages/faapz/pdo)[ Docs](https://github.com/FaaPz/PDO)[ RSS](/packages/faapz-pdo/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (30)Used By (4)

PDO
===

[](#pdo)

[![Latest Stable Version](https://camo.githubusercontent.com/b102fa8a75b4ad2fdb5d1c1bac29157167a67974a8e450c30f2f70999324ebd0/68747470733a2f2f706f7365722e707567782e6f72672f666161707a2f70646f2f762f737461626c65)](https://packagist.org/packages/faapz/pdo)[![Total Downloads](https://camo.githubusercontent.com/51bbd37114e7ed2d30eb4993c2df7f54b4b3b980c473fd8fcfe0f4498c2a2667/68747470733a2f2f706f7365722e707567782e6f72672f666161707a2f70646f2f646f776e6c6f616473)](https://packagist.org/packages/faapz/pdo)[![Latest Unstable Version](https://camo.githubusercontent.com/32bd39be5032e7bac6fe389dc7ea44ed224b7831b935911703125e97bed7260a/68747470733a2f2f706f7365722e707567782e6f72672f666161707a2f70646f2f762f756e737461626c65)](https://packagist.org/packages/faapz/pdo)[![License](https://camo.githubusercontent.com/5a11ea35316099021f0f3eaf72b6f0d935a468b1e8ee823d2317af6eb869b0a2/68747470733a2f2f706f7365722e707567782e6f72672f666161707a2f70646f2f6c6963656e7365)](https://packagist.org/packages/faapz/pdo)

Just another PDO database library

### Installation

[](#installation)

Use [Composer](https://getcomposer.org/)

```
$ composer require faapz/pdo
```

### Usage

[](#usage)

Examples selecting, inserting, updating and deleting data from or into `users` table.

```
require_once 'vendor/autoload.php';

$dsn = 'mysql:host=your_db_host;dbname=your_db_name;charset=utf8';
$usr = 'your_db_username';
$pwd = 'your_db_password';

$database = new FaaPz\PDO\Database($dsn, $usr, $pwd);

// SELECT * FROM users WHERE id = ?
$select = $database->select()
                   ->from('users')
                   ->where(new FaaPz\PDO\Clause\Conditional('id', '=', 1234));

if ($insert->execute()) {
    $data = $stmt->fetch();
}

// INSERT INTO users (id , username , password) VALUES (? , ? , ?)
$insert = $database->insert(
                       'id',
                       'username',
                       'password'
                   )
                   ->into('users')
                   ->values(
                       1234,
                       'user',
                       'passwd'
                   );

if ($insert->execute()) {
    $insertId = $database->lastInsertId();
}

// UPDATE users SET pwd = ? WHERE id = ?
$update = $database->update(["pwd" => "your_new_password"])
                   ->table("users")
                   ->where(new FaaPz\PDO\Clause\Conditional("id", "=", 1234));

if (($result = $update->execute()) !== false) {
    $affectedRows = $result->rowCount();
}

// DELETE FROM users WHERE id = ?
$delete = $database->delete()
                   ->from("users")
                   ->where(new FaaPz\PDO\Clause\Conditional("id", "=", 1234));

if (($result = $delete->execute()) !== false) {
    $affectedRows = $result->rowCount();
}
```

> The `sqlsrv` extension will fail to connect when using error mode `PDO::ERRMODE_EXCEPTION` (default). To connect, you will need to explicitly pass `array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING)` (or `PDO::ERRMODE_SILENT`) into the constructor, or override the `getDefaultOptions()` method when using `sqlsrv`.

### Documentation

[](#documentation)

See [DOCUMENTATION](docs/README.md)

### Changelog

[](#changelog)

See [CHANGELOG](CHANGELOG.md)

### License

[](#license)

See [LICENSE](LICENSE.md)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance46

Moderate activity, may be stable

Popularity53

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 61.5% 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 ~126 days

Recently: every ~313 days

Total

29

Last Release

402d ago

Major Versions

v1.12.0 → v2.0.02019-10-03

PHP version history (3 changes)1.7.0PHP &gt;=5.3.0

1.x-devPHP &gt;=5.6.0

v2.0.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ffbcb85560ec3429523929b2697d4dcc5968b77bd741ba44bf230c43daf473ca?d=identicon)[FaaPz](/maintainers/FaaPz)

![](https://www.gravatar.com/avatar/b4908b429b924b015ba7068223413a26bff2ccbe7fdac117662481bd88e20059?d=identicon)[kwhat](/maintainers/kwhat)

---

Top Contributors

[![kwhat](https://avatars.githubusercontent.com/u/676164?v=4)](https://github.com/kwhat "kwhat (99 commits)")[![FaaPz](https://avatars.githubusercontent.com/u/1536742?v=4)](https://github.com/FaaPz "FaaPz (48 commits)")[![scheras](https://avatars.githubusercontent.com/u/7363137?v=4)](https://github.com/scheras "scheras (3 commits)")[![delef](https://avatars.githubusercontent.com/u/2103263?v=4)](https://github.com/delef "delef (2 commits)")[![mridah](https://avatars.githubusercontent.com/u/21169606?v=4)](https://github.com/mridah "mridah (1 commits)")[![Mystael](https://avatars.githubusercontent.com/u/7067059?v=4)](https://github.com/Mystael "Mystael (1 commits)")[![procket-org](https://avatars.githubusercontent.com/u/5643421?v=4)](https://github.com/procket-org "procket-org (1 commits)")[![terah](https://avatars.githubusercontent.com/u/2120322?v=4)](https://github.com/terah "terah (1 commits)")[![bmutinda](https://avatars.githubusercontent.com/u/1729141?v=4)](https://github.com/bmutinda "bmutinda (1 commits)")[![WFrancois](https://avatars.githubusercontent.com/u/5872952?v=4)](https://github.com/WFrancois "WFrancois (1 commits)")[![bnf](https://avatars.githubusercontent.com/u/473155?v=4)](https://github.com/bnf "bnf (1 commits)")[![ismnoiet](https://avatars.githubusercontent.com/u/5025240?v=4)](https://github.com/ismnoiet "ismnoiet (1 commits)")[![kernel64](https://avatars.githubusercontent.com/u/1070435?v=4)](https://github.com/kernel64 "kernel64 (1 commits)")

---

Tags

pdopdo-database-libraryphp-libraryphp72query-builderdatabasesqlpdo

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/faapz-pdo/health.svg)

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

###  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)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[paragonie/easydb

Easy-to-use database abstraction

744273.4k23](/packages/paragonie-easydb)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[ezsql/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

86946.7k](/packages/ezsql-ezsql)

PHPackages © 2026

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