18.05.2012, 22:04
Hey everyone, I've got a weird problem since 2 or 3 days, but I don't know what it is due to. I only know that the problem deals with my 'INSERT INTO' statement:
Script:
mysql_log error:
OnQueryError (samp-server.exe):
Does anybody know what's wrong?
Script:
pawn Код:
else if(strlen(inputtext) > 4 && strlen(inputtext) < 21)
{
new escapedpassword[20], ip[16], query[128], string[128];
mysql_real_escape_string(inputtext, escapedpassword);
GetPlayerIp(playerid, ip, sizeof(ip));
format(query, sizeof(query), "INSERT INTO users(id, username, password, ip, money, score, kills, deaths) VALUES('', '%s', SHA1('%s'), '%s', 0, 0, 0, 0)", pName(playerid), escapedpassword, ip);
mysql_function_query(connection, query, true, "", ""); // also tried with 'false'
format(string, sizeof(string), "[SERVER] Account successfully created! (Nickname: %s | Password: %s)", pName(playerid), escapedpassword);
SendClientMessage(playerid, COLOR_GREEN, string);
}
pawn Код:
[00:03:40] Passing query INSERT INTO users(id, username, password, ip, money, score, kills, deaths) VALUES('0', 'Skyrocker', SHA1('okguy'), '127.0.0.1', |
[00:03:40] CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()
[00:03:40] OnQueryError() - Called.
pawn Код:
[00:03:40] EID: 1064 | Error: 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 | Query: INSERT INTO users(id, username, password, ip, money, score, kills, deaths) VALUES('0', 'Skyrocker', SHA1('okguy'), '127.0.0.1',