I test with the simplest code,
opens the transaction, inserts data, and rolls back
.
but the database still inserts new data
.
my database type is InnoDB
so I wonder if that"s what it says in the document,
pay attention to make sure your database connection uses the same one during transaction operations.
Db::startTrans();
$data = [
"setting_id" => 1,
"user_agent" => "123123",
"rewrite_url" => "qweqwe"
];
Db("cdn_mobile")->insert($data);
Db::rollback();