SA-MP Forums Archive
Input line too long (after substitutions) - 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)
+--- Thread: Input line too long (after substitutions) (/showthread.php?tid=393127)



Input line too long (after substitutions) - aa - 17.11.2012

Line

Код:
PRIMARY KEY (`id`) \
Whole code

Код:
	mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
		`id` int(11) NOT NULL AUTO_INCREMENT, \
		`name` varchar(24) NOT NULL, \
		`pass` varchar(129) NOT NULL, \
		`salt` varchar(30) NOT NULL, \
		`health` float NOT NULL, \
		`X` float NOT NULL, \
		`Y` float NOT NULL, \
		`Z` float NOT NULL, \
		`A` float NOT NULL, \
		`interior` int(2) NOT NULL, \
		`vw` int(11) NOT NULL, \
		`money` int(8) NOT NULL, \
		`level` int(2) NOT NULL, \
		`skin` int(3) NOT NULL, \
		PRIMARY KEY (`id`) \
	)", false, "SendQuery", "");



Re: Input line too long (after substitutions) - Ballu Miaa - 17.11.2012

EDIT:
pawn Код:
new str[1300];
format(str,sizeof(str),"CREATE TABLE IF NOT EXISTS `users` ( ");
strcat(str,"`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(24) NOT NULL,`pass` varchar(129) NOT NULL,`salt` varchar(30) NOT NULL,");
strcat(str,"`health` float NOT NULL,`X` float NOT NULL,`Y` float NOT NULL,`Z` float NOT NULL,`A` float NOT NULL,`interior` int(2) NOT NULL,");
strcat(str,"`vw` int(11) NOT NULL,`money` int(8) NOT NULL,`level` int(2) NOT NULL,`skin` int(3) NOT NULL,PRIMARY KEY (`id`))");

mysql_function_query(g_Handle,str , false, "SendQuery", "");



Re: Input line too long (after substitutions) - aa - 17.11.2012

I just replace my code with this or?


Re: Input line too long (after substitutions) - Ballu Miaa - 17.11.2012

Quote:
Originally Posted by aa
Посмотреть сообщение
I just replace my code with this or?
Check the edited code above!


Re: Input line too long (after substitutions) - aa - 17.11.2012

Thanks mate. Works perfectly.


Re: Input line too long (after substitutions) - Konstantinos - 17.11.2012

The problem was solved with strcat, but I will explain you what mistake did you do and you can use it with the way you did '\'.
pawn Код:
mysql_function_query(g_Handle, "CREATE TABLE IF NOT EXISTS `users` ( \
        `id` int(11) NOT NULL AUTO_INCREMENT, \
        `name` varchar(24) NOT NULL, \
        `pass` varchar(129) NOT NULL, \
        `salt` varchar(30) NOT NULL, \
        `health` float NOT NULL, \
        `X` float NOT NULL, \
        `Y` float NOT NULL, \
        `Z` float NOT NULL, \
        `A` float NOT NULL, \
        `interior` int(2) NOT NULL, \
        `vw` int(11) NOT NULL, \
        `money` int(8) NOT NULL, \
        `level` int(2) NOT NULL, \
        `skin` int(3) NOT NULL, \
        PRIMARY KEY (`id`) )"
, false, "SendQuery", "");
The symbol '\' can be used inside the " ", and for each time, it's like continues the string on the next line. You used the symbol and then a parenthesis ')'. Although, that was not a part from a string. Check the code above which is the correct way.