removing DB opens/closes

This commit is contained in:
Jokob-sk
2023-01-01 12:49:11 +11:00
parent ec32fca3f9
commit b86cbb3a39
11 changed files with 114 additions and 187 deletions

View File

@@ -49,9 +49,6 @@ function getParameter() {
// query the database if no cache entry found or requesting live data for the Back_App_State in the header
if($parameter == "Back_App_State" || $value == "" )
{
// Open DB
OpenDB();
global $db;
$sql = 'SELECT par_Value FROM Parameters
@@ -61,8 +58,8 @@ function getParameter() {
$row = $result -> fetchArray (SQLITE3_NUM);
$value = $row[0];
// Close DB
$db->close();
// Commit DB
CommitDB();
// update cookie cache
setCache($parameter, $value);
@@ -79,9 +76,6 @@ function setParameter() {
$parameter = $_REQUEST['parameter'];
$value = $_REQUEST['value'];
// Open DB
OpenDB();
global $db;
@@ -109,8 +103,8 @@ function setParameter() {
}
}
// Close DB
$db->close();
// Commit DB
CommitDB();
// update cookie cache
setCache($parameter, $value);