PHPackages                             esyoil-gmbh/php7-mysql-shim - 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. esyoil-gmbh/php7-mysql-shim

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

esyoil-gmbh/php7-mysql-shim
===========================

A PHP 7 shim for ext/mysql

1.0.0beta2(9y ago)08MITPHPPHP &gt;=5.3.6

Since Jul 4Pushed 7y agoCompare

[ Source](https://github.com/bennet-esyoil/php7-mysql-shim)[ Packagist](https://packagist.org/packages/esyoil-gmbh/php7-mysql-shim)[ RSS](/packages/esyoil-gmbh-php7-mysql-shim/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/d4b84bc4657ac1f920edfa6b5fd049b308a50aade5b5f40b56851ec9de711717/68747470733a2f2f7472617669732d63692e6f72672f6473686166696b2f706870372d6d7973716c2d7368696d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dshafik/php7-mysql-shim)[![Build status](https://camo.githubusercontent.com/e11c0d5ba5199be952d9a36372f8c03e0b0d28fa8e245debe28cbb554f40db6b/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f74766a3630763479336f306d6e3477703f7376673d74727565)](https://ci.appveyor.com/project/dshafik/php7-mysql-shim)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0ed310f42de17330cac30e8031b624737ae90ee5df6d7c2ea69036f0c6401944/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6473686166696b2f706870372d6d7973716c2d7368696d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dshafik/php7-mysql-shim/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/13098597cc6c31f775e0a193d8d1bd3940cfd33d18f72824adbadaac81a910c2/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6473686166696b2f706870372d6d7973716c2d7368696d2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dshafik/php7-mysql-shim/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/caa49a1b12f968a6ac7ef8d3fb1cc64e7f959437b217f6dc546d175bb6adb4d1/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f34336332386535342d396334612d343062342d396363392d6436343039643738316464612f6d696e692e706e67)](https://insight.sensiolabs.com/projects/43c28e54-9c4a-40b4-9cc9-d6409d781dda)

PHP 7 Shim for ext/mysql
========================

[](#php-7-shim-for-extmysql)

This library attempts to create a drop-in replacement for ext/mysql on PHP 7 using mysqli.

For the most part, it should *just work*.

Why You Shouldn't Use This Library
----------------------------------

[](#why-you-shouldnt-use-this-library)

This library is meant to be a *stop-gap*. It will be slower than using the native functions directly.

**You should switch to `ext/pdo_mysql` or `ext/mysqli`, and migrate to [prepared queries](http://php.net/manual/en/pdo.prepared-statements.php) to ensure you are securely interacting with your database.**

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

[](#installation)

To install, either add `dshafik/php7-mysql-shim` to your `composer.json`:

```
$ composer require dshafik/php7-mysql-shim
```

or, clone/download this repo, and include `lib/mysql.php` in your project.

Usage
-----

[](#usage)

When installed with composer, the library is included automatically.

Once the `lib/mysql.php` file is included, it will create `mysql_*` functions if they don't already exist. ***You may safely include the file in a PHP 5.3.6+ project***, it will do nothing if the mysql extension is already available.

Caveats
-------

[](#caveats)

- Calls to `is_resource()` and `get_resource_type()` on MySQL connections and results will fail as these are now their `mysqli` equivalents.
- Some errors are now from `ext/mysqli`, and others are `E_USER_WARNING` instead of `E_WARNING`.
- You must use the `mysqli.*` INI entries instead of `mysql.*` (e.g. `mysqli.default_user` instead of `mysql.default_user`)
- If no host, username, password parameter is provided when using the `mysql_*` functions, the default values from the corresponding `mysqli.*` settings from `php.ini` file will be used (e.g. `mysqli.default_host`, `mysqli.default_user`, `mysqli.default_pw`)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.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 ~252 days

Total

5

Last Release

2589d ago

Major Versions

0.2.0 → 1.0.0beta12017-01-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/e3ffeae5fd77848c6fc967341d319d9eb53315579b1652a5a4faba2f12dcef9b?d=identicon)[bennet-esyoil](/maintainers/bennet-esyoil)

---

Top Contributors

[![dshafik](https://avatars.githubusercontent.com/u/58074?v=4)](https://github.com/dshafik "dshafik (67 commits)")[![philip](https://avatars.githubusercontent.com/u/42943?v=4)](https://github.com/philip "philip (5 commits)")[![bennet-esyoil](https://avatars.githubusercontent.com/u/48118908?v=4)](https://github.com/bennet-esyoil "bennet-esyoil (2 commits)")[![eryx12o45](https://avatars.githubusercontent.com/u/6588960?v=4)](https://github.com/eryx12o45 "eryx12o45 (2 commits)")[![ASA1-ET-JENKINS](https://avatars.githubusercontent.com/u/48315530?v=4)](https://github.com/ASA1-ET-JENKINS "ASA1-ET-JENKINS (2 commits)")[![staabm](https://avatars.githubusercontent.com/u/120441?v=4)](https://github.com/staabm "staabm (1 commits)")[![stefket](https://avatars.githubusercontent.com/u/1169903?v=4)](https://github.com/stefket "stefket (1 commits)")[![SwenVanZanten](https://avatars.githubusercontent.com/u/3099122?v=4)](https://github.com/SwenVanZanten "SwenVanZanten (1 commits)")[![webysther](https://avatars.githubusercontent.com/u/750007?v=4)](https://github.com/webysther "webysther (1 commits)")[![gharlan](https://avatars.githubusercontent.com/u/330436?v=4)](https://github.com/gharlan "gharlan (1 commits)")[![mekras](https://avatars.githubusercontent.com/u/192067?v=4)](https://github.com/mekras "mekras (1 commits)")[![muhammedalialat](https://avatars.githubusercontent.com/u/8521941?v=4)](https://github.com/muhammedalialat "muhammedalialat (1 commits)")[![sonnysavage](https://avatars.githubusercontent.com/u/5487663?v=4)](https://github.com/sonnysavage "sonnysavage (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/esyoil-gmbh-php7-mysql-shim/health.svg)

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

###  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)
