Store thread data in sqlite db instead of file.

This commit is contained in:
Retro_Guy 2023-08-22 05:34:37 -07:00
parent ee6e0f8b24
commit 17ad7a29cf
2 changed files with 978 additions and 985 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1499,6 +1499,23 @@ function mail_db_open($database, $table = 'messages')
return ($dbh);
}
function threads_db_open($database, $table="threads")
{
try {
$dbh = new PDO('sqlite:' . $database);
} catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
exit();
}
$dbh->exec("CREATE TABLE IF NOT EXISTS $table(
id INTEGER PRIMARY KEY,
headers TEXT,
unique (headers))");
$stmt = $dbh->query('CREATE INDEX IF NOT EXISTS id_headers on ' . $table . '(headers)');
$stmt->execute();
return ($dbh);
}
function history_db_open($database, $table = 'history')
{
try {