public function query($sql, &$values=array())
	{
		if ($this->logging)
		{
			if ($values) {
				$this->logger->addInfo($sql, $values);
			} else {
				$this->logger->addInfo($sql);
			}
		}

		$this->lastQuery = $sql;
		try {
			if (!($sth = $this->connection->prepare($sql)))
				throw new DatabaseException($this);
		} catch (PDOException $e) {
			throw new DatabaseException($this);
		}

		$sth->setFetchMode(PDO::FETCH_ASSOC);

		try {
			if (!$sth->execute($values))
				throw new DatabaseException($this);
		} catch (PDOException $e) {
			throw new DatabaseException($e);
		}
		return $sth;
	}
public function query($sql, &$values=array())
	{
		if ($this->logging)
		{
			if ($values) {
				$this->logger->addInfo($sql, $values);
			} else {
				$this->logger->addInfo($sql);
			}
		}

		$this->lastQuery = $sql;
		try {
			if (!($sth = $this->connection->prepare($sql)))
				throw new DatabaseException($this);
		} catch (PDOException $e) {
			throw new DatabaseException($this);
		}

		$sth->setFetchMode(PDO::FETCH_ASSOC);

		try {
			if (!$sth->execute($values))
				throw new DatabaseException($this);
		} catch (PDOException $e) {
			throw new DatabaseException($e);
		}
		return $sth;
	}
public function query ( $ sql , & $ values = array ( ) ) { if ( $ this -> logging ) { if ( $ values ) { $ this -> logger -> addInfo ( $ sql , $ values ) ; } else { $ this -> logger -> addInfo ( $ sql ) ; } } $ this -> lastQuery = $ sql ; try { if ( ! ( $ sth = $ this -> connection -> prepare ( $ sql ) ) ) throw new DatabaseException ( $ this ) ; } catch ( PDOException $ e ) { throw new DatabaseException ( $ this ) ; } $ sth -> setFetchMode ( PDO :: FETCH_ASSOC ) ; try { if ( ! $ sth -> execute ( $ values ) ) throw new DatabaseException ( $ this ) ; } catch ( PDOException $ e ) { throw new DatabaseException ( $ e ) ; } return $ sth ; }
Execute a raw SQL query on the database.

@param string $sql Raw SQL string to execute.
@param array &$values Optional array of bind values
@return mixed A result set object
Execute a raw SQL query on the database .