[FIX] Settings return value on empty result
This commit is contained in:
parent
5f2a7c01c4
commit
7785fbf8b7
@ -14,7 +14,8 @@ class Setting extends Base {
|
|||||||
public function getValue($name) {
|
public function getValue($name) {
|
||||||
$stmt = $this->mysqli->prepare("SELECT value FROM $this->table WHERE name = ? LIMIT 1");
|
$stmt = $this->mysqli->prepare("SELECT value FROM $this->table WHERE name = ? LIMIT 1");
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $name) && $stmt->execute() && $result = $stmt->get_result())
|
if ($this->checkStmt($stmt) && $stmt->bind_param('s', $name) && $stmt->execute() && $result = $stmt->get_result())
|
||||||
return $result->fetch_object()->value;
|
if ($result->num_rows > 0)
|
||||||
|
return $result->fetch_object()->value;
|
||||||
return $this->sqlError();
|
return $this->sqlError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user