05.10.2015, 09:14
Hello.
I have problem with log when i insert query to mysql do not show field "message".
I used global string "buffer" (new buffer[2000] to formatted.
Stock:
Used:
and it not work...
but it work...
What is wrong? please help me.
I have problem with log when i insert query to mysql do not show field "message".
I used global string "buffer" (new buffer[2000] to formatted.
Stock:
Код:
WriteLog(message[], type) { new ttime[6]; getdate(ttime[0], ttime[1], ttime[2]); gettime(ttime[3], ttime[4], ttime[5]); format(buffer,sizeof(buffer),"INSERT INTO `Logs` SET `text` = '%s', `type_log` = '%d', `data` = '%d.%d.%d %02d:%02d:%02d'", message, type, ttime[3],ttime[4],ttime[5],ttime[0],ttime[1],ttime[2]); mysql_query(buffer); return 1; }
Код:
public OnPlayerText(playerid, text[]) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, MAX_PLAYER_NAME); format(buffer,sizeof(buffer),"[CHAT] Player: %s, text: %s",pname,text); WriteLog(buffer, 1); return 1; }
Код:
[10:54:55] CMySQLHandler::Query(INSERT INTO `Logs` SET `text` = '', `type_log` = '8', `data` = '10.54.55 2015:10:05') - Successfully executed. [10:55:31] >> mysql_query( Connection handle: 1 )
Код:
CMD:test2(playerid, params[]) return WriteLog(params, 0);
Код:
[10:51:39] CMySQLHandler::Query(INSERT INTO `Logs` SET `text` = 'helloooo', `type_log` = '0', `data` = '10.51.39 2015:10:05') - Successfully executed. [10:51:41] >> mysql_query( Connection handle: 1 )