PHPackages                             majenkotech/dbwrapper - 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. majenkotech/dbwrapper

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

majenkotech/dbwrapper
=====================

Simple MySQL db wrapper functions using PDO

v0.2.1(8y ago)049BSD3PHP

Since Jan 4Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (9)Used By (0)

Simple PDO MySQL Wrapper Class
==============================

[](#simple-pdo-mysql-wrapper-class)

This is a simple class for providing a simple API to the PDO MySQL database driver.

It relies on all tables in your database having a column called `id` which is typically a `serial` type (`bigint(20) unsigned auto_increment`). This column is used to select individual records within a table.

Usage
-----

[](#usage)

1. Create an object:

    $db = new \\Majenkotech\\DB("username", "password", "hostname", "database");
2. Execute a query with optional embedded arguments:

    $q = $db-&gt;query("SELECT name,size FROM something WHERE foo=:bar AND baz=:fod", array( "bar" =&gt; 23, "fod" =&gt; "beep" ) );
3. Use `$db->nextRecord($q)` to get successive record objects:

    while ($r = $db-&gt;nextRecord($q)) { print "$r-&gt;name is $r-&gt;size\\n"; }

Other useful functions
----------------------

[](#other-useful-functions)

- Insert a new record into a table:

    $id = $db-&gt;insert("tablename", array( "field1" =&gt; "value", "field2" =&gt; value, ... etc ... ));
- Get ID of last inserted record:

    $id = $db-&gt;id();
- Update a record in a table:

    $db-&gt;update("table", $id, array( "field1" =&gt; "value", "field2" =&gt; value, ... etc ... ));
- Select a record by ID:

    $r = $db-&gt;select("tablename", $id);
- Set a single value in a record in a table:

    $db-&gt;set("table", $id, "field", "value");

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Total

8

Last Release

3033d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e510ffaa7db4ee87725e8bef1976b0632bb769a4056f9b10ca54419ae1b15d2?d=identicon)[majenkotech](/maintainers/majenkotech)

---

Top Contributors

[![majenkotech](https://avatars.githubusercontent.com/u/3812892?v=4)](https://github.com/majenkotech "majenkotech (13 commits)")

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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