SA-MP Forums Archive
Mysql bugs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mysql bugs (/showthread.php?tid=205851)



Mysql bugs - Ice-cup - 02.01.2011

I got the following snippet:

Код:
    format(string,sizeof(string), "UPDATE `Accounts` SET `AdminLevel` = %i,`Money` = %i, `Bank` = %i, `Faction` = %i, `Rank` = %i, `HouseKey` = %i, `BizKey` = %i, `Skin` = %i, `Spawn1` = '%f', `Spawn2` = '%f', `Spawn3` = '%f', `Spawn4` = '%f', `Spawn5` = %i, `Reg` = %i, `Sex` = %i, `Wallet` = %i, `Renting` = %i, `Products` = %i, `PhoneNumber` = %i, `Minutes` = %i, `Spawn6` = %i, `Arrested` = %i, `Prisoned` = %i, `Jailed` = %i, `JailTime` = %i, \
	`Cell` = %i, `Towe` = %i, `License` = %i, `Linked` = %i, `ForumName` = '%s', `ForumPassword` = '%s', `wLicense` = %i, `Job` = %i, `Donator` = %i, `CarParts` = %i, `PlayingTime` = %i, `FightingStyle` = %i WHERE `Name` = '%s'",
(after the last , comes the variables)

I got the following errors:

Quote:

error 075: input line too long (after substitutions)
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "UPDATE"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Any idea?


Re: Mysql bugs - Kaylux - 02.01.2011

Post the rest of your code from that query. I see no problems with it. You also don't need that "\".


Re: Mysql bugs - Toreno - 02.01.2011

You need to split them, example:
pawn Код:
new mysql[128];
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `AdminLevel`='%i'",PlayerData); // Your ENUM configuration.
mysql_query(mysql); // Use yours ...
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `Money`='%i'",PlayerData); // Your ENUM configuration.
mysql_query(mysql); // Use yours ...
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `Bank`='%i'",PlayerData); // Your ENUM configuration.
mysql_query(query); // Use yours ...
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `Faction`='%i'",PlayerData);  // Your ENUM configuration.
mysql_query(mysql); // Use yours ...
And more and more...


Re: Mysql bugs - BlackBank - 02.01.2011

If you can read, it says the line is TO LONG. ;p

Just query it 2/3 times.


Re: Mysql bugs - Kaylux - 02.01.2011

Quote:
Originally Posted by EliranPesahov
Посмотреть сообщение
You need to split them, example:
pawn Код:
new mysql[128];
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `AdminLevel`='%i'",PlayerData); // Your ENUM configuration.
mysql_query(mysql); // Use yours ...
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `Money`='%i'",PlayerData); // Your ENUM configuration.
mysql_query(mysql); // Use yours ...
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `Bank`='%i'",PlayerData); // Your ENUM configuration.
mysql_query(query); // Use yours ...
format(mysql, sizeof(mysql), "UPDATE `Accounts` SET `Faction`='%i'",PlayerData);  // Your ENUM configuration.
mysql_query(mysql); // Use yours ...
And more and more...
Theres actually no need to do that. I tested his code with what he gave with no errors. You don't need to do that many query's......


Re: Mysql bugs - Ice-cup - 02.01.2011

Код:
    format(string,sizeof(string), "UPDATE `Accounts` SET `AdminLevel` = %i,`Money` = %i, `Bank` = %i, `Faction` = %i, `Rank` = %i, `HouseKey` = %i, `BizKey` = %i, `Skin` = %i, `Spawn1` = '%f', `Spawn2` = '%f', `Spawn3` = '%f', `Spawn4` = '%f', `Spawn5` = %i, `Reg` = %i, `Sex` = %i, `Wallet` = %i, `Renting` = %i, `Products` = %i, `PhoneNumber` = %i, `Minutes` = %i, `Spawn6` = %i, `Arrested` = %i, `Prisoned` = %i, `Jailed` = %i, `JailTime` = %i, \
	`Cell` = %i, `Towe` = %i, `License` = %i, `Linked` = %i, `ForumName` = '%s', `ForumPassword` = '%s', `wLicense` = %i, `Job` = %i, `Donator` = %i, `CarParts` = %i, `PlayingTime` = %i, `FightingStyle` = %i WHERE `Name` = '%s'",
    AccountData[playerid][AdminLevel],GetPlayerCash(playerid),AccountData[playerid][Bank],
	AccountData[playerid][Faction],AccountData[playerid][Rank],AccountData[playerid][HouseKey],
	AccountData[playerid][BizKey],GetPlayerSkin(playerid),AccountData[playerid][Spawn][0],AccountData[playerid][Spawn][1],AccountData[playerid][Spawn][2],AccountData[playerid][Spawn][3],
	AccountData[playerid][InteriorSpawn],AccountData[playerid][Reg],AccountData[playerid][Sex],GetPlayerWalletCash(playerid),AccountData[playerid][Renting],AccountData[playerid][Products],
	AccountData[playerid][PhoneNumber],AccountData[playerid][Minutes],AccountData[playerid][WorldSpawn],AccountData[playerid][Arrested],AccountData[playerid][Prisoned],AccountData[playerid][Jailed],
	AccountData[playerid][JailTime],AccountData[playerid][Cell],AccountData[playerid][Towe],AccountData[playerid][License], AccountData[playerid][Linked], AccountData[playerid][ForumName],
	AccountData[playerid][ForumPassword],AccountData[playerid][wLicense],AccountData[playerid][pJob], AccountData[playerid][Donator], AccountData[playerid][CarParts], AccountData[playerid][PlayingTime],
	AccountData[playerid][FightingStyle],GetUserName(playerid));
	mysql_query(string, MYSQL_SAVE_USERS);
The / makes sure the line continues.


Re: Mysql bugs - Toreno - 02.01.2011

Quote:
Originally Posted by Kaylux
Посмотреть сообщение
Theres actually no need to do that. I tested his code with what he gave with no errors. You don't need to do that many query's......
Yes, I knew it... I thought It may be good for him.
My point is that It would be better If It shows each one, It's good for me :]


Re: Mysql bugs - Kaylux - 02.01.2011

For something that long. You should split in half.


Re: Mysql bugs - Ice-cup - 02.01.2011

Quote:
Originally Posted by Kaylux
Theres actually no need to do that. I tested his code with what he gave with no errors. You don't need to do that many query's......
But it gave no errors for you?


Re: Mysql bugs - Kaylux - 02.01.2011

That was my bad. I ran it under a stock.