anchor.diff:  escape(html, [Char | Text]) ->
       [Char | escape(html, Text)].
   
  -
  -create_table(#state{dbref=DBRef}) ->
  -	?INFO_MSG("Mysql Conn.: ~p", [DBRef]),
  -	Query =  ["CREATE TABLE IF NOT EXISTS ", table_name(), "(",
  -                "id INT AUTO_INCREMENT PRIMARY KEY, ",
  -                "fromJid VARCHAR(255) NOT NULL,",
  -				"toJid VARCHAR(255) NOT NULL,",
  -				"sentDate TIMESTAMP NOT NULL,",
  -				"body TEXT,",
  -				"type VARCHAR(10)",
  -                ") ENGINE=MyISAM CHARACTER SET utf8"],
  -	case sql_query_internal(DBRef, Query) of
  -		{updated, _} -> ok;
  -		{error, _Reason} -> error
  -	end.
  -
  -insert_row(FromJid, ToJid, Body, Type) ->
  -	[{_, DBRef}] = ets:lookup(mod_log_chat_mysql5, dbref),
  -	Query = ["INSERT INTO ", table_name(), " (fromJid, toJid, sentDate, body, type) VALUES",
  -	 		"(\"",
  -	FromJid,
  -	"\", \"",
  -	ToJid, "\", NOW(), \"",
  -	Body, "\", \"", Type ,"\");"],
  -
  -	case sql_query_internal(DBRef, Query) of
  -		{updated, _} -> ok;
  -		{error, _Reason} -> error
  -	end.
  -
  -
  -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -%
  -% SQL internals
  -%
  -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  -sql_query_internal(DBRef, Query) ->
  -    case sql_query_internal_silent(DBRef, Query) of
  +sql_query(Query) ->
  +    case sql_query_internal_silent(Query) of
            {error, Reason} ->
  -            ?ERROR_MSG("~p while ~p", [Reason, lists:append(Query)]),
  +           ?INFO_MSG("~p while ~p", [Reason, lists:append(Query)]),
               {error, Reason};
            Rez -> Rez
       end.
   
  -sql_query_internal_silent(DBRef, Query) ->
  -    ?DEBUG("DOING: \"~s\"", [lists:append(Query)]),
  -    get_result(mysql_conn:fetch(DBRef, Query, self())).
  +sql_query_internal_silent(Query) ->
  +    ?INFO_MSG("DOING: \"~s\"", [lists:append(Query)]),
  +    get_result(mysql:fetch(mod_log_chat_mysql5_db, Query)).
   
   get_result({updated, MySQLRes}) ->
       {updated, mysql:get_result_affected_rows(MySQLRes)};
  
positive.code: %%%----------------------------------------------------------------------
  %%% File    : mod_log_chat_mysql5.erl
  %%% Author  : Jérôme Sautret <jerome.sautret@process-one.net>
  %%% Author  : Michael Weibel <michael.weibel@amiadogroup.com>
  %%% Purpose : Log chat messages in a mysql dbs
  %%%----------------------------------------------------------------------
  
  -module(mod_log_chat_mysql5).
  -author('michael.weibel@amiadogroup.com').
  
  -behaviour(gen_mod).
  
  -export([start/2,
  	init/1,
  	stop/1,
  	log_packet_send/3,
  	handle_info/2, terminate/2]).
  
  %%-define(ejabberd_debug, true).
  
  
negative.code: log_packet(_From, _To, _Packet) ->
      ok.
  
  %% parse message and send to db connection gen_server
  write_packet(From, To, Packet, Type) ->
      Body = escape(html, xml:get_path_s(Packet, [{elem, "body"}, cdata])),
      case Body of
  