Browse Source

Fix

pull/1/head
Václav Španinger 1 year ago
parent
commit
74f6779c63
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      app/models/managers/SettingsManager.php

+ 9
- 5
app/models/managers/SettingsManager.php View File

@ -22,11 +22,15 @@ class SettingsManager{
}
public static function update ($name, $value) {
try {
Db::edit ('settings', ['value' => $value], 'WHERE name = ?', array($name));
} catch(PDOException $error) {
echo $error->getMessage();
die();
if ($this.getByName($name)){
$this->create($name, $value);
} else {
try {
Db::edit ('settings', ['value' => $value], 'WHERE name = ?', array($name));
} catch(PDOException $error) {
echo $error->getMessage();
die();
}
}
}
}

Loading…
Cancel
Save