PHPackages                             softon/mysqli-dbclass - 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. softon/mysqli-dbclass

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

softon/mysqli-dbclass
=====================

A simple Object Oriented approach for accessing Mysql Databases.

v1.0.0(10y ago)3134MITPHPPHP &gt;=5.3.0

Since Aug 7Pushed 10y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (1)Used By (0)

mysqliDBclass
=============

[](#mysqlidbclass)

MySQLi Database Class for PHP Developers

A simple Object Oriented approach for accessing Mysql Databases. This class will make your life easy while developing your products and saves a lot of time that is wasted while creating simple CRUD operations. This class also suports Transactions. Good Error Reporting and Debuging features. Additional quick commands that provide better security and ease of developing. Refer example.php for all the sample code.

This class is an enhanced version of PHP MySQL wrapper v3 by [ricocheting.com](http://www.ricocheting.com/code/php/mysql-database-class-wrapper-v3). Hence it is compatible with the class. To use the enhanced MySQL Wrapper simply include the Database.class.php in your code and everything should work as before.

How to Setup
------------

[](#how-to-setup)

Before you start, edit the config.inc.php to match your database credentials. Then include the Class file and config file on the top of the code where you want to use the class as show below.

```

include_once('config.inc.php');
include_once('Database.php');

```

Create a DB object to interact with the class.

```

$db = new Database(DB_SERVER,DB_USER,DB_PASS,DB_DATABASE);

```

You are all set to run any query with this $db object. If you are inside a function or a another class you may call the obtain function to recover the $db object.

```

$db = new Database::obtain();

```

How to Use
----------

[](#how-to-use)

```
//Simple Raw Query
$result = $db->query("SELECT * FROM authors")->fetch();

//Parametrised Query and fetch one Record
$result = $db->query("SELECT * FROM :table WHERE :name = ':value'",['table'=>'authors','name'=>'paperid','value'=>'P12206436'])->fetch();

//Parametrised Query and fetch all Records
$result_array = $db->query("SELECT * FROM :table WHERE :name = ':value'",['table'=>'authors','name'=>'paperid','value'=>'P12206436'])->fetch_all();

// Find a row by id and fetch
$result = $db->findById('authors',1);

// Find a row by column and fetch
$result = $db->findByCol('authors','paperid','P12206436');

// Count All rows in a table
$result = $db->count('authors');

// Count All rows in a table with condition
$result = $db->count('authors'," astatus='Approved'");

// Update a row
$result = $db->update('authors',['paperid'=>'SHIBU']," id = '1'");

// Update a row with parameter protection
$result = $db->update('authors',['paperid'=>'SHIBU','aname'=>'test','aorg'=>'test']," id = '1'",['paperid','aname']);

// Bulk Update a row with parameter protection without transaction
$result = $db->bulk_update('authors',array(
    1=> array('paperid'=>'SHIBU','aname'=>'test','aorg'=>'test'),
    2=> array('paperid'=>'SHIBU2','aname'=>'test2','aorg'=>'test2')
),['paperid','aname']);

// Bulk Update a row without parameter protection with transaction
$result = $db->bulk_update('authors',array(
    1=> array('paperid'=>'SHIBU','aname'=>'test','aorg'=>'test'),
    2=> array('paperid'=>'SHIBU2','aname'=>'test2','aorg'=>'test2')
),null,true);

// Insert Data
$result = $db->insert('authors',['paperid'=>rand(1234,99999),'aname'=>'Test Ing']);

// Bulk Insert with parameter protection with transaction
$result = $db->bulk_insert('authors',array(
    array('paperid'=>'SHIBU','aname'=>'test','aorg'=>'test'),
    array('paperid'=>'SHIBU2','aname'=>'test2','aorg'=>'test2')
),['paperid','aname'],true);

// Delete a record
$result = $db->delete('authors'," id=1 ");
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

3937d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b1203b3f0be622a928325d7138799bd0b50f4f7f5b09c608630c9961b3b0625?d=identicon)[softon](/maintainers/softon)

### Embed Badge

![Health badge](/badges/softon-mysqli-dbclass/health.svg)

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

###  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.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

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

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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