PHPackages                             rawphp/raw-database - 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. rawphp/raw-database

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

rawphp/raw-database
===================

RawDatabase is a wrapper with useful utility functions around the MySQLi class and is used by RawPHP framework and other applications.

0440[3 issues](https://github.com/rawphp/RawDatabase/issues)PHP

Since Jan 4Pushed 11y ago1 watchersCompare

[ Source](https://github.com/rawphp/RawDatabase)[ Packagist](https://packagist.org/packages/rawphp/raw-database)[ RSS](/packages/rawphp-raw-database/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

RawDatabase - A Simple MySQLi Database Wrapper for PHP Applications
===================================================================

[](#rawdatabase---a-simple-mysqli-database-wrapper-for-php-applications)

[![Build Status](https://camo.githubusercontent.com/ef2108b68f317673819cf397ce8a1f2df55114315c98484c548dfd6e23688330/68747470733a2f2f7472617669732d63692e6f72672f7261777068702f52617744617461626173652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rawphp/RawDatabase) [![Coverage Status](https://camo.githubusercontent.com/e17fb4ec3cf51f5de8322180505392e47ab6176150dece0850654724b06ac28d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f7261777068702f52617744617461626173652f62616467652e706e67)](https://coveralls.io/r/rawphp/RawDatabase)[![Latest Stable Version](https://camo.githubusercontent.com/719b1e2c16dd67814b68332bbd2dd7b54012e8b973eba0bfa9679cf4d46242bb/68747470733a2f2f706f7365722e707567782e6f72672f7261777068702f7261772d64617461626173652f762f737461626c652e737667)](https://packagist.org/packages/rawphp/raw-database) [![Total Downloads](https://camo.githubusercontent.com/3ccb0c71a4c39d7cb06665d3531914fc7fd9fb6ada5adf73ba0c06c5c327db32/68747470733a2f2f706f7365722e707567782e6f72672f7261777068702f7261772d64617461626173652f646f776e6c6f6164732e737667)](https://packagist.org/packages/rawphp/raw-database)[![Latest Unstable Version](https://camo.githubusercontent.com/91135fd5f2385c045758431ce2bdea1ecc2fb8c6face039e10271497c08648af/68747470733a2f2f706f7365722e707567782e6f72672f7261777068702f7261772d64617461626173652f762f756e737461626c652e737667)](https://packagist.org/packages/rawphp/raw-database) [![License](https://camo.githubusercontent.com/68af21c8f00113a446ead48cc915d46670b721b8a90419966a248b53f23c3258/68747470733a2f2f706f7365722e707567782e6f72672f7261777068702f7261772d64617461626173652f6c6963656e73652e737667)](https://packagist.org/packages/rawphp/raw-database)

[![SensioLabsInsight](https://camo.githubusercontent.com/65965ed51fae67e5d8f4a9fd40151f8194adf06b10656be14283c8d582a0b1fc/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f66363231636332632d373364622d343864622d383466632d3237366235623432383131372f6269672e706e67)](https://insight.sensiolabs.com/projects/f621cc2c-73db-48db-84fc-276b5b428117)

Package Features
----------------

[](#package-features)

- Query your database with `query( )`
- Insert records with `insert( )`
- Execute commands with `execute( )`
- Create and drop tables with `createTable( )` and `dropTable( )`
- Add and drop columns with `addColumn( )` and `dropColumn( )`
- Add and drop indexes with `addIndex( )` and `dropIndex( )`
- Supports INDEX, PRIMARY KEY, UNIQUE, FULLTEXT and SPATIAL index
- Add and drop foreign keys with `addForeignKey( )` and `dropForeignKey( )`
- Transaction support with `startTransaction( )`, `commitTransaction( )` and `rollbackTransaction( )`
- Lock and unlock tables with `lockTables( )` and `unlockTables( )`

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

[](#installation)

### Composer

[](#composer)

RawDatabase is available via [Composer/Packagist](https://packagist.org/packages/rawphp/raw-database).

Add `"rawphp/raw-database": "0.*@dev"` to the require block in your composer.json and then run `composer install`.

```
{
        "require": {
            "rawphp/raw-database": "0.*@dev"
        }
}
```

You can also simply run the following from the command line:

```
composer require rawphp/raw-database "0.*@dev"
```

### Tarball

[](#tarball)

Alternatively, just copy the contents of the RawDatabase folder into somewhere that's in your PHP `include_path` setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub.

Basic Usage
-----------

[](#basic-usage)

```
