QuickBooks/Driver/Sql/Mysqli.php
protected function _query($sql, &$errnum, &$errmsg, $offset = 0, $limit = null)
	{
		if ($limit)
		{
			if ($offset)
			{
				$sql .= " LIMIT " . (int) $offset . ", " . (int) $limit;
			}
			else
			{
				$sql .= " LIMIT " . (int) $limit;
			}
		}
		else if ($offset)
		{
			// @todo Should this be implemented...?
		}
		
		$res = $this->_conn->query($sql);
		
		$this->_last_error = '';
		if (!$res)
		{
			$errnum = $this->_conn->errno;
			$errmsg = $this->_conn->error;
			$this->_last_error = $this->_conn->error;
			
			//print($sql);
			
			trigger_error('Error Num.: ' . $errnum . "\n" . 'Error Msg.:' . $errmsg . "\n" . 'SQL: ' . $sql . "\n" . 'Database: ' . $this->_dbname, E_USER_ERROR);
			return false;
		}
		
		return $res;
	}
protected function _query($sql, &$errnum, &$errmsg, $offset = 0, $limit = null)
	{
		if ($limit)
		{
			if ($offset)
			{
				$sql .= " LIMIT " . (int) $offset . ", " . (int) $limit;
			}
			else
			{
				$sql .= " LIMIT " . (int) $limit;
			}
		}
		else if ($offset)
		{
			// @todo Should this be implemented...?
		}
		
		$res = $this->_conn->query($sql);
		
		$this->_last_error = '';
		if (!$res)
		{
			$errnum = $this->_conn->errno;
			$errmsg = $this->_conn->error;
			$this->_last_error = $this->_conn->error;
			
			//print($sql);
			
			trigger_error('Error Num.: ' . $errnum . "\n" . 'Error Msg.:' . $errmsg . "\n" . 'SQL: ' . $sql . "\n" . 'Database: ' . $this->_dbname, E_USER_ERROR);
			return false;
		}
		
		return $res;
	}
Query the database

@param string $sql
@return resource