PHPackages                             sectoroverload2k/php-mysql-database - 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. sectoroverload2k/php-mysql-database

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

sectoroverload2k/php-mysql-database
===================================

PHP Library for OO MySQLi connection and queries

1.0.21(2mo ago)0143↓33.3%MITPHPPHP &gt;=8.0.0

Since Jul 11Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/sectoroverload2k/php-mysql-database)[ Packagist](https://packagist.org/packages/sectoroverload2k/php-mysql-database)[ Docs](https://github.com/sectoroverload2k/php-crud)[ RSS](/packages/sectoroverload2k-php-mysql-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (21)Used By (0)

php-mysql-database
==================

[](#php-mysql-database)

[![Latest Version](https://camo.githubusercontent.com/55a6aa934a3b077d6845009c2237a53264bf022c48383bf516f0232cb75fab55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736563746f726f7665726c6f6164326b2f7068702d6d7973716c2d64617461626173652e737667)](https://packagist.org/packages/sectoroverload2k/php-mysql-database)

A lightweight PHP MySQL database wrapper with prepared statement support.

Installation
------------

[](#installation)

```
composer require sectoroverload2k/php-mysql-database
```

Basic Usage
-----------

[](#basic-usage)

```
// Create a new database connection
$config = [
    'server' => 'localhost',
    'username' => 'username',
    'password' => 'password',
    'database' => 'database_name'
];

$db = new \PhpMysqlDatabase\Database($config);

// Basic query execution
$result = $db->query('SELECT * FROM users WHERE active = 1');

// Fetch all results
$users = $result->fetchAll();

// Query with parameters using prepared statement
$userId = 5;
$result = $db->query('SELECT * FROM users WHERE id = ?', [$userId]);
$user = $result->fetchAssoc();
```

Prepared Statements
-------------------

[](#prepared-statements)

The library supports fully prepared statements with typed parameter binding.

### Basic Prepared Statement

[](#basic-prepared-statement)

```
// Prepare statement
$stmt = $db->prepare('SELECT * FROM users WHERE username = ? AND status = ?');

// Bind parameters and execute
$db->bind_param($stmt, ['john_doe', 'active']);
$result = $db->execute($stmt);

// Fetch the result
$user = $result->fetchAssoc();
```

### Explicitly Defining Parameter Types

[](#explicitly-defining-parameter-types)

```
// Prepare statement
$stmt = $db->prepare('INSERT INTO products (name, price, in_stock) VALUES (?, ?, ?)');

// Bind parameters with explicit types: string, double, integer
$db->bind_param($stmt, ['Laptop', 999.99, 10], 'sdi');
$db->execute($stmt);

// Get the inserted ID
$productId = $db->insert_id();
```

### Parameter Types

[](#parameter-types)

When binding parameters, the following type identifiers are available:

- `i` - Integer
- `d` - Double (floating-point number)
- `s` - String
- `b` - Blob (binary data)

If you don't specify types, they will be automatically detected based on the PHP variable types.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance83

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Recently: every ~108 days

Total

20

Last Release

86d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f0a0462b1e78fdbc05fbe6beb4a573476e72cfeb3112a5f1f90dcf37b94db95?d=identicon)[sectoroverload2k](/maintainers/sectoroverload2k)

---

Top Contributors

[![sectoroverload2k](https://avatars.githubusercontent.com/u/3073583?v=4)](https://github.com/sectoroverload2k "sectoroverload2k (24 commits)")

---

Tags

mysqlcrud

### Embed Badge

![Health badge](/badges/sectoroverload2k-php-mysql-database/health.svg)

```
[![Health](https://phpackages.com/badges/sectoroverload2k-php-mysql-database/health.svg)](https://phpackages.com/packages/sectoroverload2k-php-mysql-database)
```

###  Alternatives

[mevdschee/php-crud-api

Single file PHP script that adds a REST API to a SQL database.

3.7k63.8k9](/packages/mevdschee-php-crud-api)[ezsql/ezsql

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

86946.7k](/packages/ezsql-ezsql)[jv2222/ezsql

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

87311.3k2](/packages/jv2222-ezsql)[simple-crud/simple-crud

Create/Read/Update/Delete easily

2396.3k3](/packages/simple-crud-simple-crud)

PHPackages © 2026

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