PHPackages                             xy2z/pdodb - 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. xy2z/pdodb

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

xy2z/pdodb
==========

PDO wrapper library for PHP 7.0+

2.0.0(5y ago)155[1 PRs](https://github.com/xy2z/PDODB/pulls)MITPHPPHP &gt;=7.0

Since Dec 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xy2z/PDODB)[ Packagist](https://packagist.org/packages/xy2z/pdodb)[ RSS](/packages/xy2z-pdodb/feed)WikiDiscussions master Synced yesterday

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

PDODB
=====

[](#pdodb)

Requirements
------------

[](#requirements)

- PHP 7.0 or above

Usage
-----

[](#usage)

```
use xy2z\PDODB\PDODB;

$pdo = new PDODB('host', 'database', 'user', 'password', 'mysql','utf8');

// Change default database.
$pdo->use('test');

// Select query
$data = $pdo->select("SELECT * FROM tablename");
$data = $pdo->select("SELECT * FROM tablename LIMIT :limit", ['limit' => 10]);
$data = $pdo->select("SELECT id, age FROM tablename WHERE name LIKE :name", ['name' => '%Demogorgon%']);
foreach ($data as $row) {
	echo $row->id;
}

// Select a single row
$row = $pdo->select_row('SELECT name, age FROM users WHERE id = :id', ['id' => 4]);
echo $row->name;

// Select a single field
$name = $pdo->select_field('SELECT name FROM tablename WHERE id = :id', [
	'id' => 24
]);
echo $name;

// Insert row
$id = $pdo->insert_row('tablename', [
	'name' => 'The Dude',
	'age' => 234
]);
echo 'Inserted ID: ' . $id;

// Insert multiple rows (accepts array of (objects/arrays))
$count = $pdo->insert_multi('tablename', [
	(object) ['name' => 'Will', 'age' => '11'],
	['name' => 'El', 'age' => '11'],
]);
echo 'Inserted ' . $count . ' rows.';

// Update
$fields = [
	'name' => 'New Name',
	'age' => '12'
];
$count = $pdo->update('tablename', $fields, ['id' => 24]);
echo 'Updated ' . $count . ' rows.';

// Delete rows
$count = $pdo->delete('tablename', ['id' => 14]);
echo 'Deleted ' . $count . ' rows.';

// Transaction.
try {
	$pdo->transaction_start();

	$pdo->insert_row('users', ['username' => 'Elliot']);
	$pdo->delete('tablename', ['id' => 60]);

	$pdo->transaction_commit();
} catch(Exception $e) {
	var_dump('Error: ' . $e->getMessage());
	$pdo->transaction_rollback();
}

// Query
$statement = $pdo->query("DELETE FROM tablename WHERE name LIKE :name", ['name' => '%del%']);
echo 'Deleted ' . $pdo->affected_rows($statement) . ' rows.';
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~286 days

Recently: every ~554 days

Total

9

Last Release

789d ago

Major Versions

1.1.1 → 2.0.02021-04-16

2.0.0 → v3.x-dev2024-03-14

PHP version history (2 changes)1.0.1PHP &gt;=7.0

v3.x-devPHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d4c08a97e1c9c53efb123c306f551fcb367e8adea3bfa1412c49c8e5133aeff?d=identicon)[xy2z](/maintainers/xy2z)

---

Top Contributors

[![xy2z](https://avatars.githubusercontent.com/u/4496997?v=4)](https://github.com/xy2z "xy2z (22 commits)")

---

Tags

composercomposer-packagepdopdo-wrapperphp7mysqlpdomysqlipdo-wrapper

### Embed Badge

![Health badge](/badges/xy2z-pdodb/health.svg)

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

###  Alternatives

[sergeytsalkov/meekrodb

The Simple PHP/MySQL Library

341387.0k10](/packages/sergeytsalkov-meekrodb)[ezsql/ezsql

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

86946.7k](/packages/ezsql-ezsql)[jv2222/ezsql

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

87311.3k2](/packages/jv2222-ezsql)[codesvault/howdy-qb

Mysql Query Builder for WordPress

371.2k1](/packages/codesvault-howdy-qb)

PHPackages © 2026

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