06.12.2011, 03:13
PHP код:
stock SaveAccount(playerid)
{ // Сохранение аккаунта.
if(PlayerInfo[playerid][pLogged] == true)
{ // Проверка, если аккаунт авторизован.
CheckMySQLConnection(); // Проверяем, подключена ли БД.
new query[800], sqlname[MAX_PLAYER_NAME], sqlpass[64], string[800];
new sqlskin = PlayerInfo[playerid][pSkin];
new admin = PlayerInfo[playerid][pAdmin];
new bann = PlayerInfo[playerid][pBanned];
new warn = PlayerInfo[playerid][pWarns];
new money = PlayerInfo[playerid][pMoney];
new timed = PlayerInfo[playerid][pMuted];
new mutetime = PlayerInfo[playerid][pMuteTime];
new level = PlayerInfo[playerid][pLevel];
new member = PlayerInfo[playerid][pMember];
new leader = PlayerInfo[playerid][pLeader];
new rank = PlayerInfo[playerid][pRank];
new fskin = PlayerInfo[playerid][pFSkin];
new prova = PlayerInfo[playerid][pProva];
new moto = PlayerInfo[playerid][pMoto];
new lodka = PlayerInfo[playerid][pLodka];
new avia = PlayerInfo[playerid][pAvia];
mysql_real_escape_string(PlayerInfo[playerid][pName], sqlname);
mysql_real_escape_string(PlayerInfo[playerid][pPassword], sqlpass);
strcat(string,"UPDATE `Accounts` SET `NickName` = '%s', `Password` = '%s', `Skin` = '%i', `Admin` = '%i', `Ban` = '%i', `Warn` = '%i', `Money` = '%i', `Muted` = '%i', `MuteTime` = '%i'",sizeof(string));
strcat(string,", `Level` = '%i', `Member` = '%i', `Leader` = '%i', `Rank` = '%i', `FSkin` = '%i', `Prova` = '%i', `Moto` = '%i', `Lodka` = '%i', `Avia` = '%i' WHERE `ID` = '%i'",sizeof(string));
format(query, sizeof(query),string, sqlname, sqlpass,sqlskin,admin,bann,warn,money,timed,mutetime,level,member,leader,rank,fskin,prova,moto,lodka,avia,PlayerInfo[playerid][pID]);
mysql_query(query); // Отправляем запрос
}
return 1;
}
Читает из базы даннх нормально, а вот обновить не может