• Lightweight
    20KB around with only one file.
  • Easy
    Extremely easy to learn and use, friendly construction.
  • Powerful
    Support various common and complex SQL queries.
  • Compatible
    Support various SQL database, including MySQL, MSSQL, SQLite, MariaDB, Oracle, Sybase, PostgreSQL and more.
  • Security
    Prevent SQL injection.
  • Free
    Under MIT license, you can use it anywhere if you want.

Get Started

Composer require

$ composer require catfan/Medoo

Update

$ composer update

Get Started

  1. // If you installed via composer, just use this code to requrie autoloader on the top of your projects.
  2. require 'vendor/autoload.php';
  3.  
  4. // Or if you just download the medoo.php into directory, and require it with the correct path.
  5. require_once 'medoo.php';
  6.  
  7. // Initialize
  8. $database = new medoo([
  9. 'database_type' => 'mysql',
  10. 'database_name' => 'name',
  11. 'server' => 'localhost',
  12. 'username' => 'your_username',
  13. 'password' => 'your_password',
  14. 'charset' => 'utf8'
  15. ]);
  16.  
  17. // Enjoy
  18. $database->insert('account', [
  19. 'user_name' => 'foo',
  20. 'email' => 'foo@bar.com',
  21. 'age' => 25,
  22. 'lang' => ['en', 'fr', 'jp', 'cn']
  23. ]);
Go to main page