04.01.2012, 15:07
(
Последний раз редактировалось [MG]Dimi; 04.01.2012 в 17:00.
)
Hello people. I have, somehow, weird problem. Yesterday my script worked perfectly, everything was saved correctly etc. Now when I have added some additional rows to save in it doesn't work.
This is code:
Those self callbacks are good. it compiles without errors. I searched MySQL's logs and I found this
Any help? If you have any other questions or needs to fix this just ask and don't say " Use Search" .
This is code:
pawn Код:
stock SaveUser(playerid)
{
if(Info[playerid][logged] == 1)
{
if(Info[playerid][Duty] != -1) Info[playerid][Duty] = 1;
new string[1024];
if(IsPlayerRegisteredOnMySQL(PlayerName(playerid)))
{
format(string, sizeof(string), "UPDATE 'Users' SET 'Logged' = '0', 'Level' = '%d', 'Kills' = '%d', 'Deaths' = '%d', 'Money' = '%d', 'Score' = '%d', 'Jailed' = '%d', 'LastIP' = '%s', 'Status' = '%d' WHERE 'Username' = '%s' LIMIT 1",Info[playerid][AdminLevel],Info[playerid][Kills],
Info[playerid][Deaths],GetPVarInt(playerid,"Money"),GetPlayerScore(playerid),Info[playerid][Jailed],PlayerIP(playerid),Info[playerid][Status],PlayerName(playerid));
mysql_query(string);
format(string, sizeof(string), "UPDATE 'Users' SET 'vip' = '%d', 'vipTime' = '%d', 'Warning' = '%d', 'Duty' = '%d', 'First' = '%d', 'Second' = '%d', 'Third' = '%d', 'Rules' = '%d' WHERE `Username` = '%s' LIMIT 1",Info[playerid][VIP],Info[playerid][VIPTime],Info[playerid][Warning],
Info[playerid][Duty],Info[playerid][First],Info[playerid][Second],Info[playerid][Third],Info[playerid][Rules],PlayerName(playerid));
mysql_query(string);
}
else
{
format(string, sizeof(string), "/Users/%s.txt", PlayerName(playerid));
dini_Set(string,"LastIP",PlayerIP(playerid));
dini_IntSet(string,"Logged",Info[playerid][logged]);
dini_IntSet(string,"Level",Info[playerid][AdminLevel]);
dini_IntSet(string,"Kills",Info[playerid][Kills]);
dini_IntSet(string,"Deaths",Info[playerid][Deaths]);
dini_IntSet(string,"Money",Info[playerid][Money]);
dini_IntSet(string,"Score",GetPlayerScore(playerid));
dini_IntSet(string,"Jailed",Info[playerid][Jailed]);
dini_IntSet(string,"Status",Info[playerid][Status]);
dini_IntSet(string,"vip",Info[playerid][VIP]);
dini_IntSet(string,"vipTime",Info[playerid][VIPTime]);
dini_IntSet(string,"Warning",Info[playerid][Warning]);
dini_IntSet(string,"Duty",Info[playerid][Duty]);
dini_IntSet(string,"First",Info[playerid][First]);
dini_IntSet(string,"Second",Info[playerid][Second]);
dini_IntSet(string,"Third",Info[playerid][Third]);
dini_IntSet(string,"Rules,",Info[playerid][Rules]);
}
}
return true;
}
Код:
[16:08:12] CMySQLHandler::Query(UPDATE 'Users' SET 'Logged' = '0', 'Level' = '5', 'Kills' = '379', 'Deaths' = '170', 'Money' = '33700', 'Score' = '124', 'Jailed' = '0', 'LastIP' = '178.148.226.235', 'Status' = '1' WHERE 'Username' = '[MG]Dimi' LIMIT 1) - 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 ''Users' SET 'Logged' = '0', 'Level' = '5', 'Kills' = '379', 'Deaths' = '170', 'M' at line 1) [16:08:12] >> mysql_query( Connection handle: 1 ) [16:08:12] CMySQLHandler::Query(UPDATE 'Users' SET 'vip' = '0', 'vipTime' = '0', 'Warning' = '0', 'Duty' = '-1', 'First' = '1', 'Second' = '0', 'Third' = '0', 'Rules' = '0' WHERE `Username` = '[MG]Dimi' LIMIT 1) - 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 ''Users' SET 'vip' = '0', 'vipTime' = '0', 'Warning' = '0', 'Duty' = '-1', 'First' at line 1)