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

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

liquidbox/pdo-extension
=======================

v1.0-rc.1(9y ago)08MITPHPPHP &gt;=5.3

Since Nov 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/liquidbox/pdo-extension)[ Packagist](https://packagist.org/packages/liquidbox/pdo-extension)[ RSS](/packages/liquidbox-pdo-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP PDO Extension
=================

[](#php-pdo-extension)

This is a PHP PDO extension class with a basic set of insert, select, update and delete (CRUD) query helpers. Aimed at being intuitive, robust and multifunctional.

Usage
-----

[](#usage)

Database connection remains the same.

### Connection

[](#connection)

Create a common ODBC database connection.

```
$db = new PDO('odbc:dbname=hollywood;host=127.0.0.1', 'root');
```

Create a secure MySQL database connection.

```
$db = new PDO(
	'mysql:dbname=hollywood;host=127.0.0.1',
	$config['db.username'],
	$config['db.password'],
    [
        PDO::MYSQL_ATTR_SSL_KEY  => '/path/to/client-key.pem',
        PDO::MYSQL_ATTR_SSL_CERT => '/path/to/client-cert.pem',
        PDO::MYSQL_ATTR_SSL_CA   => '/path/to/ca-cert.pem'
    ]
);
```

### query() Method Override

[](#query-method-override)

This extension overrides the query method to use the power of printf formatting. Use an array in place of a string for the first argument. The order of values are the same as printf starting with the [format](http://php.net/manual/en/function.sprintf.php)followed by as many arguments as needed.

```
$res = $db->query(['UPDATE actor SET oscars = oscars + 1 WHERE id = %d', 4600]);
```

Passing a string remains functional as before.

### Query Helpers

[](#query-helpers)

The query helpers are designed to be intuitive by mirroring their SQL counterparts in syntax.

#### Creating Records

[](#creating-records)

Create a single record by passing the table name and an associative array of the column-value pair(s) to set.

```
$db->insert(
    'actor',
    [
        'name' => "Anna Kendrick",
		'gender' => "female",
        'born' => (new DateTime("August 9, 1985"))->format('Y-m-d')
    ]
);
```

Create multiple records by passing an array of associative arrays.

```
```

#### Reading Records

[](#reading-records)

Note: Short-circuited the ORDER BY clause.

```
if ($page > 1) {
	$offset = ($page - 1) * $limit
}

$res = $db->select(
	['name', 'picture'],
	'actor',
	'name LIKE "%' . $middleName . '%" AND gender = "male"',
	isset($offset) ? [$offset, $limit] : $limit
);

$actors = $res->fetchAll();
```

#### Updating Records

[](#updating-records)

```
$db->update(
	'actor',
	['oscars' => 'oscars + 1'],
	'name = "Michael Thomas Green"'
);
```

```
$db->update(
	'actor',
	[
		['latest_role' => "Moe",   'name' => "Moses Harry Horwitz"],
		['latest_role' => "Larry", 'name' => "Louis Feinberg"],
		['latest_role' => "Curly", 'name' => "Jerome Lester Horwitz"]
	]
);
```

#### Deleting Records

[](#deleting-records)

```
$db->delete('actor', 'name = "Joey Tribbiani"');
```

License
-------

[](#license)

See the [LICENSE](LICENSE.txt) file for license rights and limitations (MIT).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

3452d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8234ca98aadd933490ff60c15e6ae944e7c25fae5075ba8caa0de2368657f63d?d=identicon)[liquidbox](/maintainers/liquidbox)

---

Tags

phpdatabasemysqlsqlitepostgresqlpdoodbc

### Embed Badge

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

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

###  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)[dibi/dibi

Dibi is Database Abstraction Library for PHP

5013.8M120](/packages/dibi-dibi)[vcian/laravel-db-auditor

Database DB Auditor provide leverage to audit your MySql,sqlite, PostgreSQL database standards and also provide options to add constraints in table.

28535.1k1](/packages/vcian-laravel-db-auditor)[aura/sqlschema

Provides facilities to read table names and table columns from a database using PDO.

41234.1k4](/packages/aura-sqlschema)[delight-im/db

Safe and convenient SQL database access in a driver-agnostic way

49156.8k7](/packages/delight-im-db)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.6k11](/packages/popphp-pop-db)

PHPackages © 2026

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