Home  >  Article  >  Backend Development  >  问一个关于PHP事务的有关问题

问一个关于PHP事务的有关问题

WBOY
WBOYOriginal
2016-06-13 12:12:50913browse

问一个关于PHP事务的问题

当前文件a.php:
//事务开始
//数据库操作1

以下两行操作为a.php执行b.php的类方法:
//数据库操作2
//事务回滚1

//数据库操作3
//事务回滚2

以上情况
问题1:事务回滚1是否有效?
问题2:事务回滚2是否对数据库操作2起到作用?

------解决思路----------------------
问题1:事务回滚1是否有效?
有效

问题2:事务回滚2是否对数据库操作2起到作用?
起作用

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn