新的 SQLite3 PHP 类是否支持事务?

发布于 2024-10-04 02:53:26 字数 222 浏览 0 评论 0原文

我发现有一个新的 SQLite3 类(从 PHP 5.3.3 开始)并开始在我的最新项目中使用它。

http://www.php.net/manual/en/book.sqlite3.php

全部直到我需要交易为止都很好。我是否忽略了文档中的某些内容?我如何使用此类实现交易。

I found that there is a new SQLite3 class (as of PHP 5.3.3) and started using it in my latest project.

http://www.php.net/manual/en/book.sqlite3.php

All was well till I needed transactions. Have I overlooked something in the documentation? How could I achieve transactions using this class.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笔绘流年 2024-10-11 02:53:26

由于 SQLite3 本身支持事务,因此您似乎所需要做的就是使用查询初始化事务:BEGIN TRANSACTION(就像在其他系统中一样)和 COMMIT TRANSACTION 来完成查询集。

Since SQLite3 itself supports transactions, it would seem that all you need to do is initialise transactions with a query: BEGIN TRANSACTION (much as you would in other systems) and COMMIT TRANSACTION to finalise the queryset.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文