Download the PHP package mattbit/mysql-compat without Composer

On this page you can find all versions of the php package mattbit/mysql-compat. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mysql-compat

Old mysql functions compatibility for PHP5.6 and PHP7

Build Status Scrutinizer Code Quality SensioLabsInsight

This library tries to provide backward compatibility with the deprecated mysql_* functions.

Caveat

You really should not use this unless strictly needed: it's much better to refactor the existing code to use PDO and prepared statements directly or an ORM like Eloquent.

Although library provides an hackish replacement for mysql_real_escape_string, you ought to refactor your code to use prepared statements.

Requirements

PHP >= 5.6 with the PDO driver is required (PHP 7 is supported).

Installation

You can install mysql-compat via composer:

Usage

The mysql_-equivalent functions are available through the facade class Mattbit\MysqlCompat\Mysql.

Note that the static methods are named in a camel-case like version of the original functions, e.g. mysql_fetch_array becomes Mysql::fetchArray.

If you are using PHP7 and want to re-define the old global functions and constants without touching existing code, you can use the Mysql::defineGlobals method:

If you need more control over the connections, the database manager allows you to access the underlying objects.

This is particularly useful if you need to customize connection's DSN (e.g. to specify the charset):

To do


All versions of mysql-compat with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-pdo Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mattbit/mysql-compat contains the following files

Loading the files please wait ....