Medoo logo

The lightweight PHP database framework

Version: v2.3.0
Download View on GitHub
EN English AR العربية DE Deutsch ES Español FR Français HI हिन्दी IT Italiano JA 日本語 KO 한국어 PT Português RU Русский TH ไทย UK Українська VI Tiếng Việt 简体中文 繁體中文
Total Downloads Latest Stable Version License Backers on Open Collective Sponsors on Open Collective
Lightweight

A lightweight single-file package that keeps dependencies to a minimum.

Easy

A clean, intuitive API that helps you get started quickly.

Powerful

Designed for complex SQL, data mapping, and prepared statements without sacrificing readability.

Compatible

Works smoothly with MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, Oracle, Sybase, and more.

Friendly

Fits naturally into Laravel, CodeIgniter, Yii, Slim, and other PHP frameworks.

Free

Released under the MIT license and free to use in personal or commercial projects.

Get Started

Install with Composer

$ composer require catfan/medoo
// Load Composer's autoloader.
require 'vendor/autoload.php';

// Import the Medoo namespace.
use Medoo\Medoo;

// Create a database connection.
$database = new Medoo([
    'type' => 'mysql',
    'host' => 'localhost',
    'database' => 'name',
    'username' => 'your_username',
    'password' => 'your_password'
]);

// Insert data.
$database->insert('account', [
    'user_name' => 'foo',
    'email' => 'foo@bar.com'
]);

// Retrieve data.
$data = $database->select('account', [
    'user_name',
    'email'
], [
    'user_id' => 50
]);

echo json_encode($data);

// [{
//     "user_name" : "foo",
//     "email" : "foo@bar.com"
// }]

Sponsors

JAKWEB Writers Per Hour Mask Forex In Thai Netsyms Technologies WebMDT Wildfire