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).
- database_type -> type
- database_name -> database
- server -> host
// 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);