mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-23 20:58:46 -05:00
Fix an issue which was created while trying to fix an issue
This commit is contained in:
parent
04dee18b9c
commit
e310657cf3
@ -5,7 +5,6 @@ class SSDB
|
||||
{
|
||||
function execute($conn,$sql){
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$conn->close();
|
||||
return true;
|
||||
} else {
|
||||
return $conn->error;
|
||||
@ -14,21 +13,18 @@ class SSDB
|
||||
function getSetting($conn,$setting){
|
||||
$sql = "SELECT value FROM settings WHERE setting='".$setting."'";
|
||||
$result = $conn->query($sql);
|
||||
$ret = "none";
|
||||
|
||||
if ($result->num_rows == 1) {
|
||||
while($row = $result->fetch_assoc()) {
|
||||
$ret = $row["value"];
|
||||
return $row["value"];
|
||||
}
|
||||
} else {
|
||||
$ret = "null";
|
||||
return "null";
|
||||
}
|
||||
$conn->close();
|
||||
return $ret;
|
||||
}
|
||||
function setSetting($conn,$settingname,$settingvalue){
|
||||
$sql = "INSERT INTO settings (setting,value) VALUES ('".$settingname."','".$settingvalue."');";
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$conn->close();
|
||||
return true;
|
||||
} else {
|
||||
return $conn->error;
|
||||
@ -38,7 +34,6 @@ class SSDB
|
||||
function deleteSetting($conn,$settingname){
|
||||
$sql = "DELETE FROM settings WHERE setting=\"".$settingname."\";";
|
||||
if ($conn->query($sql) === TRUE) {
|
||||
$conn->close();
|
||||
return true;
|
||||
} else {
|
||||
return $conn->error;
|
||||
|
Loading…
Reference in New Issue
Block a user