Medoo Log的使用:返回所有执行的查询

返回所有执行的查询

log方法:log(),无需传入任何参数。

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

例:
    $database->select("account", [
        "user_name",
        "email"
    ], [
        "user_id[<]" => 20
    ]);
 
    $database->insert("account", [
        "user_name" => "foo",
        "email" => "[email protected]"
    ]);
 
    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', '[email protected]')"
    // }