PHPackages                             clearpdo/clearpdo - 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. clearpdo/clearpdo

AbandonedArchivedLibrary

clearpdo/clearpdo
=================

ClearPDO makes connecting with databases and running queries extremely simple.

061PHP

Since Nov 13Pushed 7y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

ClearPDO
--------

[](#clearpdo)

ClearPDO makes connecting with databases and running queries extremely simple.

### Usage Instructions

[](#usage-instructions)

ClearPDO extends PDO so all the things you can do with vanilla PDO your can do with ClearPDO. For example:

```
$db = new ClearPDO\PDO("mysql:host=$host;dbname=$database;charset=UTF8", $username, $password);

$db->prepare("SELECT * FROM provinces WHERE population > ?");
$db->execute(array(500000));

$provinces = $db->fetchAll();
```

But you can also use the many convenience methods that ClearPDO provides.

**Creating a MySQL Connect**

Instead of wasting time manually creating a DSN string you can use the following helper method to create a connection using a configuration array.

```
$db = ClearPDO\PDO::createMysqlConnection([
	'host'      => 'localhost',
	'port'      => '3396',
	'database'  => 'blog',
	'username'  => 'root',
	'password'  => '3GwZFRjbGezY',
	'charset'   => 'utf8',
	'collation' => 'utf8_unicode_ci',
]);
```

Or alternative using a socket connection.

```
$db = ClearPDO\PDO::createMysqlConnection([
	'unix_socket' => '/var/run/mysqld/mysqld.sock',
	'database'    => 'blog',
	'username'    => 'root',
	'password'    => '3GwZFRjbGezY',
	'charset'     => 'utf8',
	'collation'   => 'utf8_unicode_ci',
]);
```

**Using the Select Method**

```
$statement = $db->select('SELECT content FROM posts WHERE status = :status', [':status' => 'published']);
while ($post = $statement->fetch()) {
	print $post->content;
}
```

**Using the Results Method**

```
$posts = $db->results('SELECT content FROM posts WHERE status = :status', [':status' => 'published']);
foreach ($posts as $post) {
	print $post->content;
}
```

**Using the Lists Method**

```
$posts = $db->lists('SELECT id, content FROM posts WHERE status = :status', [':status' => 'published']);
foreach ($posts as $id => $content) {
	print $content;
}
```

**Using the Result Method**

```
$post = $db->result('SELECT content FROM posts WHERE id = :id', [':id' => 4]);
print $post->content;
```

**Using the Column Method**

```
$content = $db->column('SELECT content FROM posts WHERE id = :id', [':id' => 4]);
print $content;
```

**Using the Insert Method**

```
$db->insert('posts', [
	'status'  => 'draft'
	'content' => 'Vestibulum dictum, nunc vel pulvinar.',
	'created' => new DateTime,
]);
```

**Using the Update Method**

```
$data = [
	'status'  => 'published',
	'updated' => new DateTime,
];

$db->insert('posts', $data, 'id = :postID', [':postID' => 4]);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/409ca1cc960f4126409e74afcf2daeef025b45c2c07eab05576adbf24de6db9c?d=identicon)[funkjedi](/maintainers/funkjedi)

---

Top Contributors

[![funkjedi](https://avatars.githubusercontent.com/u/9314?v=4)](https://github.com/funkjedi "funkjedi (3 commits)")

### Embed Badge

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

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

PHPackages © 2026

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