libraries/ManiaLib/Database/RecordSet.php
function fetchSingleValue($default = 0, $throwException = false)
    {
        $row = $this->fetchRow();
        if ($row) {
            return reset($row);
        } elseif (!$throwException) {
            return $default;
        } else {
            throw new RecordNotFoundException('Record not found');
        }
    }
function fetchSingleValue($default = 0, $throwException = false)
    {
        $row = $this->fetchRow();
        if ($row) {
            return reset($row);
        } elseif (!$throwException) {
            return $default;
        } else {
            throw new RecordNotFoundException('Record not found');
        }
    }
Fetches a single value of the current row, or the default value if there's no row.
Typically useful for SELECT COUNT() queries.