简体   繁体   English

如何解锁 SQLite3 表?

[英]How unlock a SQLite3 table?

I'm beginner in SQL/PHP,I want to delete a column from a table with sqlite3, I use this method but when I try to execute it with php I have this error when I execute the query:我是 SQL/PHP 的初学者,我想使用 sqlite3 从表中删除一列,我使用这种方法,但是当我尝试使用 php 执行它时,我在执行查询时出现此错误:

$statement = $pdo->exec("CREATE TABLE t1_backup AS SELECT $columns FROM $tableName;DROP TABLE $tableName;ALTER TABLE t1_backup RENAME TO $tableName;");

Error: Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 6 database table is locked错误:致命错误:未捕获的 PDOException:SQLSTATE [HY000]:一般错误:6 数据库表已锁定

Whereas it works if I manually execute the query... What's the problem??而如果我手动执行查询它会起作用......有什么问题?

  • I tried to add sleep() but nothing...我试图添加 sleep() 但没有...
  • I tried to execute query one by one but nothing...我试图一个一个地执行查询,但什么都没有......
  • I try to add "BEGIN TRANSACTION" & "COMMIT"我尝试添加“BEGIN TRANSACTION”和“COMMIT”

Thank you !谢谢 !

check your SQLiteBrowser or any other editor is on and if there is any unsaved changes.检查您的 SQLiteBrowser 或任何其他编辑器是否打开,以及是否有任何未保存的更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM