Get Started

Upgrade

Where Syntax

Query

Aggregation

Fetch

Transaction

Management

Advanced

Raw object

PDO object

Debug

Information

version: 2.1.12

From v1.7 to v2.0

Simplified connection options

Those option names are simplified (you can still use the old one of course).

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

// Old
$database = new Medoo([
	'database_type' => 'mysql',
	'database_name' => 'name',
	'server' => 'localhost',
	'username' => 'your_username',
	'password' => 'your_password',
]);

Deprecated error()

The function $database->error() is deprecated. Just read the $database->error or $database->errorInfo to get the error information last performed.

$database->insert("account", [
	"user_name" => "foo"
]);

var_dump($database->error);
var_dump($database->errorInfo);