changed mysqli_query("SET NAMES..") to mysqli->set_charset
changed mysql_query("SET NAMES..") to mysql_set_charset
file_exist => is_file
added $this in function merge
file_exist => is_file
file_exist => is_file
changed open log file to write only (append)