public function fetchOne(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);
        $result = $stmt->fetch(\PDO::FETCH_COLUMN);

        $this->ok();
        return $result;
    }
public function fetchOne(string $sql, array $params = [])
    {
        $stmt = $this->prepare($sql, $params);
        $result = $stmt->fetch(\PDO::FETCH_COLUMN);

        $this->ok();
        return $result;
    }
public function fetchOne ( string $ sql , array $ params = [ ] ) { $ stmt = $ this -> prepare ( $ sql , $ params ) ; $ result = $ stmt -> fetch ( \ PDO :: FETCH_COLUMN ) ; $ this -> ok ( ) ; return $ result ; }
Return first field from first element from the result set

Example of usage
<code>
$db->fetchOne("SELECT COUNT(*) FROM users");
</code>

@param  string $sql     SQL query with placeholders
"SELECT * FROM users WHERE name = :name AND pass = :pass"
@param  array  $params  params for query placeholders (optional)
array (':name' => 'John', ':pass' => '123456')

@return string|false
@throws DbException
Return first field from first element from the result set