PHPackages                             dimns/simplepdo - 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. dimns/simplepdo

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

dimns/simplepdo
===============

Simple PDO Wrapper class for MySQL and SQLite

v1.2.0(10y ago)031MITPHPPHP &gt;=5.3.0

Since Apr 26Pushed 9y agoCompare

[ Source](https://github.com/DimNS/SimplePDO)[ Packagist](https://packagist.org/packages/dimns/simplepdo)[ Docs](http://github.com/dimns/simplepdo)[ RSS](/packages/dimns-simplepdo/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (5)Used By (0)

Project is deprecated.
----------------------

[](#project-is-deprecated)

Simple PDO Wrapper class for MySQL and SQLite
=============================================

[](#simple-pdo-wrapper-class-for-mysql-and-sqlite)

[![Latest Stable Version](https://camo.githubusercontent.com/bf22cf5c6422b757627f2cbd2f3c2144a102ce113493fa0ed9070a6bceb7f004/68747470733a2f2f706f7365722e707567782e6f72672f64696d6e732f73696d706c6570646f2f762f737461626c65)](https://packagist.org/packages/dimns/simplepdo)[![Total Downloads](https://camo.githubusercontent.com/b2528496726f22017c5dfeed1c483e1dec195b495b6a0ea0971e5d782c215a0b/68747470733a2f2f706f7365722e707567782e6f72672f64696d6e732f73696d706c6570646f2f646f776e6c6f616473)](https://packagist.org/packages/dimns/simplepdo)[![License](https://camo.githubusercontent.com/e7844303c3b09b7d15c5351909a9e32ac95a4a1bd06040e519cecb798309ee69/68747470733a2f2f706f7365722e707567782e6f72672f64696d6e732f73696d706c6570646f2f6c6963656e7365)](https://packagist.org/packages/dimns/simplepdo)

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

[](#requirements)

- PHP 5.3 or higher is required.
- PHP extension MySQL or SQLite.

Composer installation
---------------------

[](#composer-installation)

1. Get [Composer](http://getcomposer.org/).
2. Require SimplePDO with `php composer.phar require dimns/simplepdo` or `composer require dimns/simplepdo` (if the composer is installed globally).
3. Add the following to your application's main PHP file: `require 'vendor/autoload.php';`.

Usage
-----

[](#usage)

```
// Init class for MySQL (default port 3306)
$db = new DimNS\SimplePDO\MySQL('server', 'dbname', 'username', 'password');
// Or init class for MySQL (override port)
$db = new DimNS\SimplePDO\MySQL('server', 'dbname', 'username', 'password', 3307);
// Or init class for SQLite
$db = new DimNS\SimplePDO\SQLite('/path/to/database/file.sqlite');

// Query without prepared variables
$result = $db->query('SELECT `field1`, `field2` FROM `table`');
echo '';
print_r($result);
echo '';

// Query with prepared variables
$result = $db->query('INSERT INTO `table` SET
    `field1` = :field1,
    `field2` = :field2
', [
    'field1' => 'Simple string',
    'field2' => 123,
]);
echo $result;

// Transaction (only for mysql innodb table)
$result = $db->transaction([
    [
        'query' => 'INSERT INTO `table` SET `field1` = :field1, `field2` = :field2, `field3` = :field3',
        'data'  => [
            'field1' => 'val1',
            'field2' => 'val2',
            'field3' => 'val3',
        ],
    ], [
        'query' => 'UPDATE `table` SET `field1` = :field1 WHERE `field2` > :field2',
        'data'  => [
            'field1' => 'val1',
            'field2' => 'val2',
        ],
    ],
]);
echo '';
print_r($result);
echo '';
```

Return values
-------------

[](#return-values)

1. For `select` and `show` returns an array containing all of the result set rows.
2. For `insert` returns the ID of the inserted row.
3. For all other queries returns the number of rows affected by the SQL statement.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

3656d ago

### Community

Maintainers

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

---

Top Contributors

[![DimNS](https://avatars.githubusercontent.com/u/8703922?v=4)](https://github.com/DimNS "DimNS (7 commits)")

---

Tags

mysqlsqlitepdo

### Embed Badge

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

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k605.0M6.7k](/packages/doctrine-dbal)[nette/database

💾 Nette Database: layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.

5687.0M261](/packages/nette-database)[dibi/dibi

Dibi is Database Abstraction Library for PHP

5014.0M131](/packages/dibi-dibi)[aura/sql

A PDO extension that provides lazy connections, array quoting, query profiling, value binding, and convenience methods for common fetch styles. Because it extends PDO, existing code that uses PDO can use this without any changes to the existing code.

5892.7M55](/packages/aura-sql)[aura/sqlquery

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

4883.1M37](/packages/aura-sqlquery)[ezsql/ezsql

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

86748.3k](/packages/ezsql-ezsql)

PHPackages © 2026

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