Question

stock OnPlayerSaveAccount(playerid)
{
	if(PlayerInfo[playerid][pLogin] != true) return print("Ошибка сохранения | Игрок не авторизован");
	new string[340];
	mysql_format(connects,string,340,"UPDATE `accounts` SET `pFuelcar` = '%f',`pFuelcar1` = '%f',`pFuelcar2` = '%f',`pCash` = '%d',`pMuteTime` = '%d',`pRMuteTime` = '%d',`pChar` = '%d', `pPrisonTime` = '%d', `pJailTime` = '%d', `pJailed` = '%d', `pPm` = '%d', `aPrefix` = '%s' WHERE `id` = '%i', `pSlotItem0` = '%d', `pSlotItem1` = '%d', `pSlotItem2` = '%d', `pSlotItem3` = '%d', `pSlotItem4` = '%d', `pSlotItem5` = '%d'",
	PlayerInfo[playerid][pFuelCar][0],PlayerInfo[playerid][pFuelCar][1],PlayerInfo[playerid][pFuelCar][2],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pMuteTime],PlayerInfo[playerid][pRMuteTime],PlayerInfo[playerid][pChar],
	PlayerInfo[playerid][pPrison][1],PlayerInfo[playerid][pJailTime],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pPm],PlayerInfo[playerid][aPrefix],PlayerInfo[playerid][pID],
	PlayerInfo[playerid][pSlotItem][0],PlayerInfo[playerid][pSlotItem][1],PlayerInfo[playerid][pSlotItem][2],PlayerInfo[playerid][pSlotItem][3],PlayerInfo[playerid][pSlotItem][4],PlayerInfo[playerid][pSlotItem][5]);
	mysql_empty(connects, string);
	printf("Name: %s [%d] | pID: [%d] - сохранен",PlayerInfo[playerid][pNames],playerid,PlayerInfo[playerid][pID]);
	return 1;
}
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 ' `pSlotItem0` = '19352', `pSlotItem1` = '0', `pSlotItem2` = '0', `pSlotItem' at line 1

Не идет сохранение в БД

Edited by FENRIS

Share this post


Link to post

1 answer to this question

  • 0

@FENRIS Неверно сформирована строка запроса. Замените свой запрос этим и попробуйте вновь. 

UPDATE `accounts` SET `pFuelcar` = '%f',`pFuelcar1` = '%f',`pFuelcar2` = '%f',`pCash` = '%d',`pMuteTime` = '%d',`pRMuteTime` = '%d',`pChar` = '%d', `pPrisonTime` = '%d', `pJailTime` = '%d', `pJailed` = '%d', `pPm` = '%d', `aPrefix` = '%s', `pSlotItem0` = '%d', `pSlotItem1` = '%d', `pSlotItem2` = '%d', `pSlotItem3` = '%d', `pSlotItem4` = '%d', `pSlotItem5` = '%d' WHERE `id` = '%i'"

 

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • Dexter Nomad
      By Dexter Nomad
      При попытке компиляции кода возникает ошибка:
      error 076: syntax error in the expression, or invalid function call
      Не могу найти причину, буду благодарен, если не только укажете, где сама ошибка, но еще и исправите ее.
      Сам код:
          if(strcmp(cmd, "/carsharing", true) == 0)     {         if(IsPlayerConnected(playerid))         {             if(PlayerInfo[playerid][CarLic] == 0) return SCM(playerid, COLOR_RED, "У вас нет вод.прав! Вы можете получить их в автошколе!");         }     }  
    • Sanya_Greison
      By Sanya_Greison
      Куплю РП мод под сервер без бонуса. Бюджет до 150 $
      А также скриптера с Украины
      мой вк vk.com/i_am_sashko