query_sql "DELETE FROM `chatlog` WHERE `dst_charname`='npc:whois'";
It should be:
query_logsql "DELETE FROM `chatlog` WHERE `dst_charname`='npc:whois'";
because many users don't have log db and ragnarok db the same, they may use logs in another database.