PHPackages                             mireiawen/mysqlie - 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. mireiawen/mysqlie

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

mireiawen/mysqlie
=================

MySQLi extended

0.3.0(4y ago)084MITPHPPHP &gt;=8.1.0

Since Sep 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Mireiawen/mysqlie)[ Packagist](https://packagist.org/packages/mireiawen/mysqlie)[ RSS](/packages/mireiawen-mysqlie/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (6)Used By (0)

MySQLie
=======

[](#mysqlie)

Extended MySQLi classes. All of the methods that can return error, should throw exceptions when and only error occurs.

There are also some custom methods added to make some tasks easier.

- Classes: `MySQLie`, `MySQLie_stmt`
- Namespace: `Mireiawen\MySQLie`

Requirements
------------

[](#requirements)

- MySQL Native Driver (mysqlnd)
- PHP 7

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

[](#installation)

You can clone or download the code from the [GitHub repository](https://github.com/Mireiawen/mysqlie) or you can use composer: `composer require mireiawen/mysqlie`

Methods
-------

[](#methods)

Only the custom methods are listed here, the overridden methods should behave like the original methods, except that the errors are thrown.

### Class MySQLie

[](#class-mysqlie)

The main MySQLie class

#### escape\_identifier

[](#escape_identifier)

```
MySQLie::escape_identifier(string $name)

```

Escape an identifier name for the SQL query

##### Arguments

[](#arguments)

- **string** `$name` - The identifier name to escape

##### Return value

[](#return-value)

- **string** - The escaped identifier name

#### escape\_query\_identifiers

[](#escape_query_identifiers)

```
MySQLie::escape_query_identifiers(string $sql, array $identifiers)

```

Escape the identifiers in the SQL query

##### Arguments

[](#arguments-1)

- **string** $sql - SQL query with placeholders (`%s`) for the identifiers
- **string\[\]** $identifiers - Array of the identifiers to be escaped and placed into the query

##### Return value

[](#return-value-1)

- **string** - The SQL query with identifiers escaped and placed into the query

#### foreign\_key\_checks

[](#foreign_key_checks)

```
MySQLie::foreign_key_checks(bool $state)

```

Set the foreign key checks on or off

##### Arguments

[](#arguments-2)

- **bool** $state - TRUE to enable foreign key checks, FALSE to disable them

##### Exceptions thrown

[](#exceptions-thrown)

###### \\Exception

[](#exception)

- In case of database errors

#### get\_autocommit

[](#get_autocommit)

```
MySQLie::get_autocommit()

```

##### Return value

[](#return-value-2)

- **bool** - The current `AUTOCOMMIT` status, TRUE if it is on, FALSE if it is off

##### Exceptions thrown

[](#exceptions-thrown-1)

###### \\Exception

[](#exception-1)

- In case of database errors

#### get\_autoincrement

[](#get_autoincrement)

```
MySQLie::get_autoincrement(string $table)

```

Get the table auto increment value

##### Arguments

[](#arguments-3)

- **string** `$table` - The name of the table to get the `AUTO_INCREMENT` value from

##### Return value

[](#return-value-3)

- **int** - The value of the table `AUTO_INCREMENT`

##### Exceptions thrown

[](#exceptions-thrown-2)

###### \\Exception

[](#exception-2)

- In case of database errors

#### truncate

[](#truncate)

```
MySQLie::truncate(string $table)

```

Truncates the given table to zero rows

##### Arguments

[](#arguments-4)

- **string** `$table` - Name of the table to be truncated

##### Exceptions thrown

[](#exceptions-thrown-3)

###### \\Exception

[](#exception-3)

- In case of database errors

### MySQLie\_stmt

[](#mysqlie_stmt)

#### fetch\_assoc

[](#fetch_assoc)

```
MySQLie_stmt::fetch_assoc()

```

Fetch the result as an associative array

##### Return value

[](#return-value-4)

- **array** - An array of result rows

##### Exceptions thrown

[](#exceptions-thrown-4)

###### \\Exception

[](#exception-4)

- In case of database errors

#### fetch\_first

[](#fetch_first)

```
MySQLie_stmt::fetch_first()

```

Fetch the first row of the statement and return the result as an associative array

##### Return value

[](#return-value-5)

- **array** - A result row as an associative array

##### Exceptions thrown

[](#exceptions-thrown-5)

###### \\Exception

[](#exception-5)

- In case of database errors

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

4

Last Release

1613d ago

PHP version history (2 changes)0.2.1PHP &gt;=7.3.0

0.3.0PHP &gt;=8.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b939943c063fd46acb5c8cd353ed8f69511ea19527d9196a09c382e828847bc?d=identicon)[Mireiawen](/maintainers/Mireiawen)

---

Top Contributors

[![Mireiawen](https://avatars.githubusercontent.com/u/11092031?v=4)](https://github.com/Mireiawen "Mireiawen (9 commits)")

### Embed Badge

![Health badge](/badges/mireiawen-mysqlie/health.svg)

```
[![Health](https://phpackages.com/badges/mireiawen-mysqlie/health.svg)](https://phpackages.com/packages/mireiawen-mysqlie)
```

###  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.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M545](/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)
