Home  >  Article  >  Backend Development  >  php中 预处理与事务同时使用

php中 预处理与事务同时使用

WBOY
WBOYOriginal
2016-06-02 11:28:281073browse

php预处理事务数据库

sql1,sql2两条语句分别插入到不同的表中,sql2某一个属性就是sql1插入后自增长的ID值,

我希望使用预处理来处理sql1和sql2, 同时希望他们执行的时候是在一个事务中, 现在问题就是, 事务中没提交的操作并没有真的插入到数据库中, 所以自增长的ID不存在,sql2插入出错, 肿麽办?

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