15.06.2012, 17:11
Quote:
Oh that sucks D: It's gonna take a while, I may as well just code a system for saving data rather than writing the queries.
This is what put me off SQL, it's just so long and drawn out to save small parts of data! I'm going to use strcat and a similar system to my file script to build a query string from input data to be updated or created. |
For me, it's easiest to read it like this.
pawn Код:
format(string1, 500, "UPDATE `Users` SET Password = '%s', Level = '%d', \
AdminLevel = '%d', VIPLevel = '%d', ConnectedTime = '%d', \
Sex = '%d', Age = '%d', Origin = '%d', Muted = '%d', \
Respect = '%d', Cash = '%d', BankAccount = '%d', \
Kills = '%d', Deaths = '%d', WantedDeaths = '%d', \
TimesArrested = '%d', Phonebook = '%d', Number = '%d', LottoNumber = '%d', ",
db_escape(PlayerInfo[playerid][pKey]),
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdminLevel],
PlayerInfo[playerid][pVip],
PlayerInfo[playerid][pConnectTime],
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pAge],
PlayerInfo[playerid][pOrigin],
PlayerInfo[playerid][pMuted],
PlayerInfo[playerid][pRespect],
PlayerInfo[playerid][pCash],
PlayerInfo[playerid][pBank],
PlayerInfo[playerid][pKills],
PlayerInfo[playerid][pDeaths],
PlayerInfo[playerid][pWantedDeaths],
PlayerInfo[playerid][pTimesArrested],
PlayerInfo[playerid][pPhoneBook],
PlayerInfo[playerid][pNumber],
PlayerInfo[playerid][pLotto]
);