Reputation: 7599
i'm trying to dump a sqLite Database from memory to file (for loggin purposes) but it gives me an error.
I've tried:
conn = new SQLite3("dump.db");
$db->backup( $conn );
but it gives me an error:
Call to undefined method SQLite3::backup()
I'm using sqLite Version 3.28.0
Any idea how it would work?
Upvotes: 0
Views: 413
Reputation: 32340
Your SQLite3 extension is old and doesn't have all the functions (SQLite3::backup
has been introduced arround PHP 7.4).
See the manual page: https://www.php.net/manual/en/sqlite3.backup.php
As of SQLite 3.27.0 (2019-02-07), it is also possible to use the statement VACUUM INTO 'file.db'; to backup the database to a new file.
If upgrading is not an option, you can simply use copy()
.
Upvotes: 1