mirror of
https://git.steelants.cz/SH/PHP_SMART_HOME_V3.git
synced 2026-10-11 17:54:34 +00:00
Fix
This commit is contained in:
1 parent
181a65a99b
commit
74f6779c63
1 file changed
+9
-5
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user