24.09.2011, 06:26
------------------ Debug ----------------------
------------- Script -------------------------
Any help for fixing this error ?
Код:
[09:12:37] CMySQLHandler::Query(INSERT INTO `players` (sqlid,Nimi,Key) VALUES ('0','Random_Name','loll')) - An error has occured. (Error ID: 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 'Key) VALUES ('0','Random_Name','loll')' at line 1) [09:12:37] CMySQLHandler::Query(SELECT * FROM `players` WHERE Nimi = 'Random_Name' AND Key = 'loll') - An error has occured. (Error ID: 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 'Key = 'loll'' at line 1) [09:12:39] CMySQLHandler::Query(UPDATE players SET Key='',AdminLevel='0',Money='0' WHERE Nimi='Random_Name') - An error has occured. (Error ID: 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 'Key='',AdminLevel='0',Money='0' WHERE Nimi='Random_Name'' at line 1)
Код:
format(string, sizeof(string), "INSERT INTO `players` (sqlid,Nimi,Key) VALUES ('0','%s','%s')", PlayerInfo[playerid][pPName], password); mysql_query(string); print(string); format(string, sizeof(string), "SELECT * FROM `players` WHERE Nimi = '%s' AND Key = '%s'", PlayerInfo[playerid][pPName], password); mysql_query(string); format(string, sizeof(string), "UPDATE players SET Key='%s',AdminLevel='%d',Money='%d' WHERE Nimi='%s'", PlayerInfo[playerid][pKey], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pPName]); mysql_query(string);