Medoo

开始

Where 语句

查询

Transaction

原生SQL查询

PDO object

Debug

数据库信息

LOG

返回所有执行的查询。

log()

Return: 开启Medoo调试模式

可以用此函数来查询、调试SQL语句

$database->select("account", [
    "user_name",
    "email"
], [
    "user_id[<]" => 20
]);

$database->insert("account", [
    "user_name" => "foo",
    "email" => "foo@bar.com"
]);

var_dump( $database->log() );
// array(2) {
//  [0]=> string(62) "SELECT "user_name","email" FROM "account" WHERE "user_id" < 20"
//  [1]=> string(74) "INSERT INTO "account" ("user_name", "email") VALUES ('foo', 'foo@bar.com')"
// }