The Lightweight PHP Database Framework to Accelerate Development

Version: 2.1.12
download Fork me on GitHub
Build Status Total Downloads Latest Stable Version License Backers on Open Collective Sponsors on Open Collective

Portable with only one file.


Easy to learn and use, friendly construction.


Supports various common and complex SQL queries, data mapping, and prevents SQL injection.


Supports MySQL, MSSQL, SQLite, MariaDB, PostgreSQL, Sybase, Oracle, and more.


Works well with every PHP framework, like Laravel, Yii, Slim, and framework which supports singleton extension or composer.


Under the MIT license, you can use it anywhere, whatever you want.

Get Started

Composer require

$ composer require catfan/medoo


$ composer update
// Require Composer's autoloader.
require 'vendor/autoload.php';

// Using Medoo namespace.
use Medoo\Medoo;

// Connect the database.
$database = new Medoo([
    'type' => 'mysql',
    'host' => 'localhost',
    'database' => 'name',
    'username' => 'your_username',
    'password' => 'your_password'

$database->insert('account', [
    'user_name' => 'foo',
    'email' => ''

$data = $database->select('account', [
], [
    'user_id' => 50

echo json_encode($data);

// [{
//     "user_name" : "foo",
//     "email" : ""
// }]
Medoo is an open-source project under the MIT license and will always be free to use. However, the project needs some funding every month to sustain itself. Any sponsorship for the project will be beneficial for us to build Medoo better for all PHP developers in the world, and we will put your company logo on the homepage as appreciation.