PHPackages                             nowendwell/mysqli-class - 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. nowendwell/mysqli-class

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

nowendwell/mysqli-class
=======================

MYSQLi Wrapper

v2.0.2(7y ago)8201[1 issues](https://github.com/nowendwell/mysqli-class/issues)MITPHPPHP &gt;=5.4.0

Since Mar 30Pushed 7y ago2 watchersCompare

[ Source](https://github.com/nowendwell/mysqli-class)[ Packagist](https://packagist.org/packages/nowendwell/mysqli-class)[ Docs](https://github.com/nowendwell/mysqli-class)[ RSS](/packages/nowendwell-mysqli-class/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

MYSQLi Class
============

[](#mysqli-class)

**Please understand that using something like this in a modern application is a bad idea. This was created before PDO and Query Builders like those seen in Laravel, CodeIgniter, etc. I highly recommend Laravel if you are looking for a better way.**

PHP class to access MySQL database wrapper using MySQLi

This class can:

- Connect to a given MySQL server
- Execute SQL queries
- Retrieve the number of query result rows, result columns and last inserted id
- Retrieve the query results in a single array
- Escape a single string or an array of literal text values to use in queries
- Determine if one value or an array of values contain common MySQL function calls
- Check of a table exists
- Check of a given table record exists
- Return a query result that has just one row
- Execute INSERT, UPDATE, UPSERT(!!!) and DELETE queries from values that define tables, field names, field values and conditions
- Truncate a table or tables
- Optimize a table or tables
- Send email messages with MySQL access and query errors
- Display the total number of queries performed during all instances of the class

Usage
=====

[](#usage)

```
require_once "class.db.php";
$db = new DB();
foreach( $db->getResults( "SELECT * FROM users_table" ) as $result )
{
  $name = $result['name'];
  $email = $result['email'];

  echo "Name: $name" . "" . "Email: $email" . "";
}
```

Stored Procedures
-----------------

[](#stored-procedures)

showProcedure($procedure)
callProcedure($procedure, $params = array(), $responses = array())

Filtering
---------

[](#filtering)

filter($data)
escape($data)
clean($data)

Queries (Getting Data)
----------------------

[](#queries-getting-data)

query($query)
getArray($query, $type = MYSQLI\_ASSOC)
getRow($query, $object = false)
getResult($query, $pos = 0)
getResults($query, $object = false)

Queries (Storing Data)
----------------------

[](#queries-storing-data)

insert($table, $variables = array())
insertMulti($table, $columns = array(), $records = array())
update($table, $variables = array(), $where = array(), $limit = null)
upsert($table, $data = array(), $where = array())

Checks
------

[](#checks)

tableExists($table)
numRows($query)
exists($table = '', $check\_val = '', $params = array())

Utilities
---------

[](#utilities)

search($table, $where = array(), $limit = null)
delete($table, $where = array(), $limit = null)
affected()
numFields($query)
showColumns($table)
truncate($tables = array())
optimize($tables = array())
totalQueries()
lastQuery()
lastId()

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.9% 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 ~186 days

Total

5

Last Release

2631d ago

Major Versions

v1.4.1 → v2.0.02018-04-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5315824?v=4)[Ben Miller](/maintainers/nowendwell)[@nowendwell](https://github.com/nowendwell)

---

Top Contributors

[![nowendwell](https://avatars.githubusercontent.com/u/5315824?v=4)](https://github.com/nowendwell "nowendwell (31 commits)")[![bennettstone](https://avatars.githubusercontent.com/u/1184010?v=4)](https://github.com/bennettstone "bennettstone (1 commits)")

---

Tags

databasemysqlwrappermysqli

### Embed Badge

![Health badge](/badges/nowendwell-mysqli-class/health.svg)

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

###  Alternatives

[sergeytsalkov/meekrodb

The Simple PHP/MySQL Library

340402.6k12](/packages/sergeytsalkov-meekrodb)[stefangabos/zebra_database

An advanced, compact and lightweight MySQL database wrapper library, built around PHP's MySQLi extension.

11712.4k](/packages/stefangabos-zebra-database)[go/db

Database library

6524.2k](/packages/go-db)[krugozor/database

PHP class library for simple, convenient, fast and safe work with MySql database, using PHP mysqli extension and imitation of prepared queries.

392.5k](/packages/krugozor-database)

PHPackages © 2026

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