[FIX] Settings return value on empty result

This commit is contained in:
Sebastian Grewe 2013-11-06 14:47:25 +01:00
parent 5f2a7c01c4
commit 7785fbf8b7

View File

@ -14,7 +14,8 @@ class Setting extends Base {
public function getValue($name) {
$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())
return $result->fetch_object()->value;
if ($result->num_rows > 0)
return $result->fetch_object()->value;
return $this->sqlError();
}