PHPackages                             amcsi/amysql - 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. amcsi/amysql

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

amcsi/amysql
============

A MySQL(i) wrapper for PHP 5.2 and higher with useful tools and no extension dependencies.

v1.1.4(11y ago)5208MITPHPPHP &gt;=5.1.0

Since Sep 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/amcsi/amysql)[ Packagist](https://packagist.org/packages/amcsi/amysql)[ Docs](https://github.com/amcsi/amysql)[ RSS](/packages/amcsi-amysql/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (20)Used By (0)

AMysql
======

[](#amysql)

[![Build Status](https://camo.githubusercontent.com/3820bff2d9789805722f96b1c495eceeb73260dd4b20cb28d7a89f13c2801903/68747470733a2f2f7472617669732d63692e6f72672f616d6373692f616d7973716c2e706e673f6272616e63683d6e657874)](https://travis-ci.org/amcsi/amysql)

A MySQL wrapper guaranteed to work on any PHP 5.2+ or HHVM configuration with the mysqli extension or `mysql_*` functions available. Also contains many tools to help build queries, manage them, profile them.

### Is AMysql for you?

[](#is-amysql-for-you)

- Feel like Zend\_Db is way too bulky, but on the other hand does not give you useful tools for common problems?
- Afraid of using PDO or Mysqli as it might not be available on the production server?
- Do not like the boring task of assembling INSERTs and UPDATEs?

Then AMysql is the library for your project!

### What AMysql tries to be

[](#what-amysql-tries-to-be)

- A library that allows you to work with mysql with any PHP configuration without requiring any extensions.
- A practical library that provides great tools for common situations in MySQL. This includes tools not available in any MySQL API (extension level or PHP level), or the combination of tools that would otherwise only be available separately in several different APIs, but never together.

### What AMysql is not

[](#what-amysql-is-not)

- **It's not an abstraction library.** Although I might add PostgreSQL support, the main focus is on MySQL, as abstraction takes focus away from being able to make good tools specifically for a type of database. Also, it would be too much work for me alone to look into how all the other databases function.
- **It's not an ORM.** There is support for fetching data into new instances of classes, but the focus is on ease of building queries.

Requirements
============

[](#requirements)

PHP 5.1.0+ is required, although this has only been tested on 5.2 and higher, and either the MySQLi extension or the mysql\_\* functions must be available.

Installation
============

[](#installation)

Available on packagist.

See [INSTALL](INSTALL.md) file.

Usage
=====

[](#usage)

Typically you want to make one instance of AMysql per db connection. AMysql lazy connects by default.

Apigen docs are available for this project:

#### Instantiating AMysql

[](#instantiating-amysql)

When instantiating AMysql, you can pass in either a mysql link resource or connection details as an array.

```
