public function fetch($query, $parameters = array())
    {
        try {
            $sth = $this->query($query, $parameters);
            if ($sth === false) {
                return false;
            }
            return $sth->fetch(PDO::FETCH_ASSOC);
        } catch (PDOException $e) {
            throw new DbException("Error query: " . $e->getMessage());
        }
    }
public function fetch($query, $parameters = array())
    {
        try {
            $sth = $this->query($query, $parameters);
            if ($sth === false) {
                return false;
            }
            return $sth->fetch(PDO::FETCH_ASSOC);
        } catch (PDOException $e) {
            throw new DbException("Error query: " . $e->getMessage());
        }
    }
public function fetch ( $ query , $ parameters = array ( ) ) { try { $ sth = $ this -> query ( $ query , $ parameters ) ; if ( $ sth === false ) { return false ; } return $ sth -> fetch ( PDO :: FETCH_ASSOC ) ; } catch ( PDOException $ e ) { throw new DbException ( "Error query: " . $ e -> getMessage ( ) ) ; } }
Returns the first row of a query result, using optional bound parameters.

@param string $query Query
@param array $parameters Parameters to bind
@return bool|mixed
@see query()
@throws Exception|DbException if an exception occurred
Returns the first row of a query result using optional bound parameters .