public function escape($string) {

        // if no active connection exists, return false
        if (!$this->_connected()) return false;

        // if "magic quotes" are on, strip slashes
        if (get_magic_quotes_gpc()) $string = stripslashes($string);

        // escape and return the string
        return mysqli_real_escape_string($this->connection, $string);

    }