<?php function db_insert_log($dbconn, $log_category, $log_value, $log_text=false) { global $Config; $sql="INSERT INTO `{$Config->TableMapLog['common']}` (" ."`log_service`, `log_reporter`, `log_reporter_ip`, `log_remote_ip`, `log_category`, `log_value`, `log_text`, `log_time`" .") VALUES (" .$dbconn->escape($Config->SERVICE_NAME,true)."," .$dbconn->escape($Config->SERVER_DOMAIN,true)."," .$dbconn->escape($_SERVER['SERVER_ADDR'],true)."," .$dbconn->escape(REMOTE_ADDR(),true)."," .$dbconn->escape($log_category,true)."," .$dbconn->escape($log_value,true)."," .$dbconn->escape($log_text,true)."," ."UTC_TIMESTAMP())"; $dbconn->real_query($sql,"error.db.insertfail"); return $dbconn->insert_id(); } ?>