public static function Escape($val)
    {
    	if (DataAdapter::$ADAPTER_INSTANCE) DataAdapter::$ADAPTER_INSTANCE->LoadDriver();

		// this is an unfortunate leftover from poor design of making this function static
		// we cannon use the driver's escape method without a static reference
		if (!DataAdapter::$DRIVER_INSTANCE) throw new Exception("DataAdapter must be instantiated before Escape can be called");

		// if magic quotes are enabled, then we need to stip the slashes that php added
		if (get_magic_quotes_runtime() || get_magic_quotes_gpc()) $val = stripslashes($val);
		
		// $driver->RequireConnection(true);
		return DataAdapter::$DRIVER_INSTANCE->Escape($val);
	}