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

ActiveLibrary

flaneurette/mysqli-db-class
===========================

A lightweight mysqli hook

00PHP

Since Jan 1Pushed 2mo agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

class.DB
========

[](#classdb)

Minimal PHP mysqli database class.

A minimal and lean PHP mysqli database class. 256 lines of code.

Installing
==========

[](#installing)

The class can be installed via two methods, composer and manual installation.

### Composer:

[](#composer)

```
composer require flaneurette/mysqli-db-class:dev-main

```

### Manual:

[](#manual)

Clone or download the dev-main.

Examples of use:
================

[](#examples-of-use)

OPEN DB
-------

[](#open-db)

```
$db = new sql();

```

SELECT:
-------

[](#select)

```
$table    = 'test';
$column   = 'id';
$value    =  1;
$operator = '*';

// becomes: select * from test where id = 1

$test = $db->select($table,$operator,$column,$value);
echo "". print_r($test) . "";

```

SELECT:
-------

[](#select-1)

```
$table    = 'test';
$column   = 'id';
$value    =  100;
$operator = 'name,email';

// becomes: select name,email from test where id = 100

$test = $db->select($table,$operator,$column,$value);
echo "". print_r($test) . "";

```

COUNT:
------

[](#count)

```
$table  = 'test';
$column = 'foo'
$value  = 'abc';
$lock   = 'LOCK';  // optional, locks the table to prevent race condition.
$db->countrows($table,$column,$value,$lock);

```

INSERT:
-------

[](#insert)

```
$table   = 'test';
$columns = ['foo','bar'];
$values  = ['abc','efg'];
$db->insert($table,$columns,$values);

```

UPDATE:
-------

[](#update)

```
$id = 2;
$table    = 'test';
$columns  = ['foo','bar'];
$values   = ['abc','efg'];
$db->update($table,$columns,$values,$id);

```

DELETE ON ID:
-------------

[](#delete-on-id)

```
$table  = 'test';
$id 	= 2;
$db->delete($table,$id);

```

QUERY (direct query, no security):
----------------------------------

[](#query-direct-query-no-security)

```
$test = $db->query("SELECT * FROM test");
echo "". print_r($test) . "";

```

CLOSE DB
--------

[](#close-db)

$db-&gt;close();

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance56

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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.

### Community

Maintainers

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

---

Top Contributors

[![flaneurette](https://avatars.githubusercontent.com/u/30347642?v=4)](https://github.com/flaneurette "flaneurette (48 commits)")

### Embed Badge

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

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

PHPackages © 2026

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