在项目开发中很多模块都会用到事务,但是在php中使用thinkphp5中事务不能回滚,解决办法

要注意三个地方,

1.MySQL数据库引擎为InnoDB 不能是MyISAM

请修改my.ini

default-storage-engine=INNODB

 2. thinkphp中不是使用

  db("test")

要使用

Db::name("test")

3. 检查MySQL中的表中使用的引擎是否为InnoDB

thinkphp5 中关于事务不能回滚问题

更改为

 thinkphp5 中关于事务不能回滚问题

经过这三步操作,就可以实现thinkphp5 中事务回滚,希望对大家有用

 

 

相关文章:

  • 2021-05-02
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2021-05-06
猜你喜欢
  • 2022-12-23
  • 2022-01-11
  • 2021-04-16
  • 2021-08-14
  • 2021-12-24
  • 2022-12-23
  • 2021-04-10
相关资源
相似解决方案