15.04.2014, 19:12
Hello friends! I've a problem with insert a new line at my database.
My script is that:
In the database looks like this:
Someone can help me pls?
My script is that:
pawn Код:
public OnRconLoginAttempt(ip[], password[], success) {
new
gQuery[200],
gBuf[2][50],
gTime[3],
gDate[3],
gLoop = -1,
gIp[20],
gName[25];
gettime(gTime[0], gTime[1], gTime[2]);
getdate(gDate[0], gDate[1], gDate[2]);
format(gBuf[0], 50, "%02i:%02i:%02i", gTime[0], gTime[1], gTime[2]);
format(gBuf[1], 50, "%02i/%02i/%04i", gDate[2], gDate[1], gDate[0]);
while (++gLoop < MAX_PLAYERS) {
GetPlayerIp(gLoop, gIp, sizeof(gIp));
if (!strcmp(ip, gIp, true)) {
format(gName, 25, getPlayerName(gLoop));
}
}
mysql_format(gDB, gQuery, "insert into rcon_logs (name, ip, pass, hour, date, success) values ('%s', '%s', '%s', '%s', '%s', %i)", gName, ip, password, gBuf[0], gBuf[1], (success) ? 1 : 0);
mysql_function_query(gDB, gQuery, false, "", "");
return 1;
}
Someone can help me pls?