PHPackages                             alisajjad/php7\_mysql - 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. alisajjad/php7\_mysql

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

alisajjad/php7\_mysql
=====================

A simple PHP Mysqli Wrapper(prepare statements) with Result collection object which provides basic functionality.

1.0.0(6y ago)05MITPHPPHP &gt;=7.2.0CI failing

Since Mar 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/alisajjad96/php7_mysql)[ Packagist](https://packagist.org/packages/alisajjad/php7_mysql)[ RSS](/packages/alisajjad-php7-mysql/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

php7\_mysql
===========

[](#php7_mysql)

A simple PHP Mysqli Wrapper(prepare statements) with Result collection object which provides basic functionality.

Requirement
-----------

[](#requirement)

- PHP 7.2 or higher with mysqli extension

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

[](#installation)

```
composer require alisajjad/php7_mysql

```

Usage
-----

[](#usage)

Initiate the Object:

```
$db = \PHP7MySql\MySql::init(
    'host',
    'username',
    'password',
    'php7_mysql',
    'prefix_of_db',
    'port',
    'socket'
);

```

Execute a simple query:

```
$db->exec($sql);

```

With Parameters:

```
$result = $db->exec($sql, [$value1, $value2], 'is')

```

Where `$value1` is first value with bind `i(int)` and `$value2` is second value with `s(string)`.

`$result` is true on success, false on failure.

Fetch Query:

```
$result = $db->fetch($sql, [$value1], 'i')

```

`$result` contains MysqlResultCollection object on success, null on failure.

#### MysqlResultCollection

[](#mysqlresultcollection)

All the query results will be stored in this object.

Common Methods:

- getAll() - returns all rows in array
- getRowsNum() - returns rows count
- isEmpty() - checks if result is empty
- first() - Returns first row
- last() - Returns last row
- nth(int $index) - Returns nth index of row
- reverse() - Reverses the rows
- merge(MysqlResultCollection $collection) - Merges given collection with current one.

The first row can be directly accessed simply by:

```
$result->first_row_column;

```

or

```
$result->first()->first_row_column;

```

Using Loop:

```
foreach ($collection as $index => $MySqlResultRow):
    echo $MySqlResultRow->column;
endforeach;

```

Limitation
----------

[](#limitation)

- MySql Object doesn't support multi-query yet.
- No Sorting deep algorithms are applied on collection yet.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

2241d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bae932c7660fb4c40864626c67cba317708c67addf6c54619ba7846cd1a205ae?d=identicon)[Ali Sajjad](/maintainers/Ali%20Sajjad)

---

Top Contributors

[![alisajjad96](https://avatars.githubusercontent.com/u/13929968?v=4)](https://github.com/alisajjad96 "alisajjad96 (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alisajjad-php7-mysql/health.svg)

```
[![Health](https://phpackages.com/badges/alisajjad-php7-mysql/health.svg)](https://phpackages.com/packages/alisajjad-php7-mysql)
```

###  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)[mongodb/mongodb

MongoDB driver library

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

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/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)
