Meddo The lightest PHP database framework to accelerate development

Friday 18th, Dec, 2015 | #PHP

View More

Medoo is extremely lightweight with only one file, easy-to-use, easy-to-learn, and optimized for high performance to increase the development experience and user experience for web application. It`s suitable for every PHP development project with SQL database needed.

The word of Medoo comes from the Latin word med (middle), that is, the intermedium between PHP and database and do everything you want between them.

Medoo is under MIT license. You can freely to use or distribute for your project as long as declaring the original copyright information.

Requirement

  • PHP 5.1+, greatly recommend for PHP 5.4+ with PDO support.
  • Installed database like MySQL, MSSQL, SQLite or more.
  • Make sure php_pdo_xxx extension is enabled and installed.
  • A little bit SQL knowledge.

Configuration & Example

    // If you installed via composer, just use this code to requrie autoloader on the top of your projects.
    require 'vendor/autoload.php';
     
    // Or if you just download the medoo.php into directory, require it with the correct path.
    require  'medoo.php';
     
    $database = new medoo([
    	// required
    	'database_type' => 'mysql',
    	'database_name' => 'name',
    	'server' => 'localhost',
    	'username' => 'your_username',
    	'password' => 'your_password',
    	'charset' => 'utf8',
     
    	// [optional]
    	'port' => 3306,
     
    	// [optional] Table prefix
    	'prefix' => 'PREFIX_',
     
    	// driver_option for connection, read more from http://www.php.net/manual/en/pdo.setattribute.php
    	'option' => [
    		PDO::ATTR_CASE => PDO::CASE_NATURAL
    	]
    ]);
     
    $database->insert("account", [
    	"user_name" => "foo",
    	"email" => "foo@bar.com"
    ]);