02.12.2013, 09:28
(
Последний раз редактировалось Mr.4o-4o; 05.12.2013 в 05:29.
)
Переписываю сохранение аккаунта на mysql, использую плагин r34, но аккаунт не сохраняется а в логах пишется:
Вот код:
PHP код:
[12:29:38] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET `Level` = '1', `AdminLevel` = '0', `Helper", callback: "(null)", format: "(null)"
[12:29:38] [DEBUG] CMySQLQuery::CMySQLQuery() - constructor called
[12:29:38] [DEBUG] mysql_tquery - scheduling query "UPDATE `accounts` SET `Level` = '1', `AdminLevel` = '0', `HelperLevel` = '0', `DonateRank` = '0', `UpgradePoints` = '0', `ConnectedTime` = '0', `Registered` = '1', `Sex` = '1', `Age` = '0', `Origin` = '0', WHERE `NickName` = 'Vasya_Pupki"..
[12:29:38] [DEBUG] CMySQLQuery::Execute[()] - starting query execution
[12:29:38] [ERROR] CMySQLQuery::Execute[()] - (error #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 'WHERE `NickName` = 'Vasya_Pupki' at line 1
[12:29:38] [DEBUG] CMySQLQuery::Execute[()] - error will be triggered in OnQueryError
[12:29:38] [DEBUG] CMySQLQuery::Execute[()] - data being passed to ProcessCallbacks()
[12:29:38] [DEBUG] CMySQLQuery::~CMySQLQuery() - deconstructor called
PHP код:
stock SaveAccount1(playerid)
{
new heap = heapspace();
printf("SaveAccount1() STK %d", heap);
new string[32]; new query[1024];
new PlayerName[24];
mysql_real_escape_string(PlayerInfo[playerid][pName], PlayerName);
format(string,sizeof(string),"UPDATE `accounts` SET "),strcat(query,string);
format(string,sizeof(string),"`Level` = '%i', ",PlayerInfo[playerid][pLevel]),strcat(query,string);
format(string,sizeof(string),"`AdminLevel` = '%i', ",PlayerInfo[playerid][pAdmin]),strcat(query,string);
format(string,sizeof(string),"`HelperLevel` = '%i', ",PlayerInfo[playerid][pHelper]),strcat(query,string);
format(string,sizeof(string),"`DonateRank` = '%i', ",PlayerInfo[playerid][pDonateRank]),strcat(query,string);
format(string,sizeof(string),"`UpgradePoints` = '%i', ",PlayerInfo[playerid][pUpgrade]),strcat(query,string);
format(string,sizeof(string),"`ConnectedTime` = '%i', ",PlayerInfo[playerid][pConnectTime]),strcat(query,string);
format(string,sizeof(string),"`Registered` = '%i', ",PlayerInfo[playerid][pReg]),strcat(query,string);
format(string,sizeof(string),"`Sex` = '%i', ",PlayerInfo[playerid][pSex]),strcat(query,string);
format(string,sizeof(string),"`Age` = '%i', ",PlayerInfo[playerid][pAge]),strcat(query,string);
format(string,sizeof(string),"`Origin` = '%i', ",PlayerInfo[playerid][pOrigin]),strcat(query,string);
format(string,sizeof(string),"WHERE `NickName` = '%s'",PlayerName),strcat(query,string);
mysql_function_query(dbHandle,query,false,"","");
printf("SaveAccount1() STK %d (%d LOSS)", heapspace(), (heap - heapspace()));
return 1;
}