jove / medoo
The lightweight PHP database framework to accelerate development
v2.1.6
2022-05-10 02:47 UTC
Requires
- php: >=7.3
- ext-pdo: *
Requires (Dev)
- phpunit/phpunit: ^9.0
Suggests
- ext-pdo_dblib: For MSSQL or Sybase database on Linux/UNIX platform
- ext-pdo_mysql: For MySQL or MariaDB database
- ext-pdo_oci: For Oracle database
- ext-pdo_pqsql: For PostgreSQL database
- ext-pdo_sqlite: For SQLite database
- ext-pdo_sqlsrv: For MSSQL database on both Window/Liunx platform
This package is not auto-updated.
Last update: 2026-06-20 16:46:19 UTC
README
PHP 8.0+ and installed PDO extension.
Get Started
Install via composer
Add Medoo to the composer.json configuration file.
$ composer require jove/medoo:dev-master
And update the composer
$ composer update
// Require Composer's autoloader. require __DIR__ .'/vendor/autoload.php'; use Amp\Loop; use function Medoo\connect; use Medoo\Drivers\MySQL; // Running the event loop Loop::run(function () { // Connect the database. $database = connect(MySQL::class, [ 'host' => 'localhost', 'database' => 'name', 'username' => 'your_username', 'password' => 'your_password' ]); // Enjoy yield $database->insert('account', [ 'user_name' => 'foo', 'email' => 'foo@bar.com' ]); $data = yield $database->select('account', [ 'user_name', 'email' ], [ 'user_id' => 50 ]); echo json_encode($data); // [{ // "user_name" : "foo", // "email" : "foo@bar.com", // }] });