Mysql bugs
#1

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?
Reply
#2

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

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...
Reply
#4

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

Just query it 2/3 times.
Reply
#5

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......
Reply
#6

Код:
    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.
Reply
#7

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 :]
Reply
#8

For something that long. You should split in half.
Reply
#9

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?
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)