Composer require
$ composer require catfan/medoo
Update
$ 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' => 'foo@bar.com'
]);
$data = $database->select('account', [
'user_name',
'email'
], [
'user_id' => 50
]);
echo json_encode($data);
// [{
// "user_name" : "foo",
// "email" : "foo@bar.com"
// }]
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.