【问题标题】:How can I handle an error when using transactions, and the table is using the myISAM engine instead of InnoDB?使用事务时如何处理错误,并且表使用的是 myISAM 引擎而不是 InnoDB?
【发布时间】:2015-05-04 13:30:10
【问题描述】:

当数据库默认不使用 myISAM 引擎,或者表使用 myISAM 而不是 InnoDB 时,php 中的 beginTransaction 函数不会返回 false。

那么,当这种情况发生时,您如何处理错误?

【问题讨论】:

    标签: php pdo transactions innodb myisam


    【解决方案1】:

    我找到了这个链接,我可以在其中查询数据库并查看表是 myisam 还是 innodb...但我不知道这是否是最佳解决方案。如果表是 myisam 或 innodb,我必须在每次查询之前检查。 How do I find if my a table is MyISAM or Innodb

    【讨论】:

    猜你喜欢
    • 2011-05-29
    • 2012-09-28
    • 2019-01-14
    • 2012-10-02
    • 2016-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-30
    相关资源
    最近更新 更多