private function querySingleValue($sql, $parameters = [])
    {
        try {
            $statement = $this->pdo->prepare($sql);
            $statement->execute($parameters);

            $value = $statement->fetchColumn();

            $statement->closeCursor();
            if ($value === false) {
                throw new StorageException("The query returned no result.");
            }
            return $value;
        } catch (\PDOException $e) {
            throw new StorageException("The query failed.", 0, $e);
        }
    }
private function querySingleValue($sql, $parameters = [])
    {
        try {
            $statement = $this->pdo->prepare($sql);
            $statement->execute($parameters);

            $value = $statement->fetchColumn();

            $statement->closeCursor();
            if ($value === false) {
                throw new StorageException("The query returned no result.");
            }
            return $value;
        } catch (\PDOException $e) {
            throw new StorageException("The query failed.", 0, $e);
        }
    }
private function querySingleValue ( $ sql , $ parameters = [ ] ) { try { $ statement = $ this -> pdo -> prepare ( $ sql ) ; $ statement -> execute ( $ parameters ) ; $ value = $ statement -> fetchColumn ( ) ; $ statement -> closeCursor ( ) ; if ( $ value === false ) { throw new StorageException ( "The query returned no result." ) ; } return $ value ; } catch ( \ PDOException $ e ) { throw new StorageException ( "The query failed." , 0 , $ e ) ; } }
Returns one value from a query.

@param string $sql        The SQL query.
@param array  $parameters The optional query parameters.

@return string The value.
@throws StorageException The query failed.
Returns one value from a query .