24.05.2012, 03:00
So I have this huge chunk of saving code, for some reason, it's not updating the row. I know it's not a problem with formatting, because I've printed the query, and the query is just right.
Just to be sure about the query, printing the query results in.
I also know that it isn't related to 'updating' empty fields because I had updated an empty field as a test like so.
and it updates fine. Can someone tell me what I'm doing wrong? I'm thinking the problem is in the query. This is bugging me.
pawn Код:
format(string1, 300, "UPDATE `Users` SET Password = '%s', AdminLevel = '%d', VIPLevel = etc etc etc");
format(string2, 350, " etc etc etc WHERE `Name` = '%s' COLLATE NOCASE");
strcat(query, string1);
strcat(query, string2);
db_query(Database, query);
Код:
[20:04:01] UPDATE `Users` SET Password = '0D22FB7594D51AD1429447E311C477C01884CF8DDEC6427146FCE64BD817D8A4522458613941237CB5954415A05C49B7D03D753711AA8C28467AB24708F0EC59', AdminLevel = '0', VIPLevel = '0', ConnectedTime = '7', Sex = '1', Age = '14', Origin = '5', Muted = '0', Respect = '0', Cash = '0', BankA Job = '0', Jailed = '0', JailTime = '0', Mats = '0', Pot = '0', Crack = '0', Leader = '0', Rank = '0', Skin = '184', Warns = '0', Banned = '0', TutStep = '0', Pos_X = '150.009536', Pos_Y = '-67.181488', Pos_Z = '1.429687', Interior = '0', VirtualWorld = '0' WHERE `Name` = 'Test' COLLATE NOCASE
pawn Код:
new
testquery[128]
;
format(testquery, 128, "UPDATE `Users` SET Level = '%d' WHERE `Name` = '%s'", 1337, GetPlayerNameEx(playerid));
db_query(Database, testquery);