[MYSQL] String not work ?
#1

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:
Код:
	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;
	}
Used:

Код:
	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;
	}
and it not work...

Код:
[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 )
but it work...

Код:
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 )
What is wrong? please help me.
Reply


Messages In This Thread
[MYSQL] String not work ? - by mroq98 - 05.10.2015, 09:14
Re: [MYSQL] String not work ? - by Prokill911 - 05.10.2015, 15:01

Forum Jump:


Users browsing this thread: 1 Guest(s)