15.08.2015, 12:22
Код:
forward OfflineBanCheck(adminid, reason[]); public OfflineBanCheck(adminid, reason[]) { new rows, fields; cache_get_data(rows, fields, mysql); if(rows) { new ip[16], name[MAX_PLAYER_NAME], seconds, query[144], string[128]; cache_get_field_content(0, "Name", name, mysql, MAX_PLAYER_NAME); cache_get_field_content(0, "IP", ip); seconds = (gettime()+604800); mysql_format(mysql, query, sizeof(query), "INSERT INTO `bans` (`Player`, `IP`, `Reason`, `Unban date`, `Banned by`) VALUES ('%e', '%e', '%e', '%d', '%e')", name, ip, reason, seconds, Name(adminid)); mysql_tquery(mysql, query, "", ""); SendClientMessage(adminid, C_LRED, "Player banned!"); } else return SendClientMessage(adminid, C_LRED, "Player not found!"); return 1; }
Код:
[08:19:12] [DEBUG] mysql_tquery - scheduling query "INSERT INTO `bans` (`Player`, `IP`, `Reason`, `Unban date`, `Banned by`) VALUES ('noob123', '94.123.200.55', 'Reason', '1440245952', '".. [08:19:12] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [08:19:12] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called [08:19:12] [DEBUG] CMySQLQuery::Execute[()] - starting query execution [08:19:12] [ERROR] CMySQLQuery::Execute[()] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1 [08:19:12] [DEBUG] CMySQLQuery::Execute[()] - error will be triggered in OnQueryError [08:19:12] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks() [08:19:12] [DEBUG] Calling callback "OnQueryError"..