Tables Help [MYSQL] - 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: Tables Help [MYSQL] (
/showthread.php?tid=554093)
Tables Help [MYSQL] -
JonathanW - 02.01.2015
So Yeah. Need help creating tables. I'll get this straight.
When I create the Table under 'OnGamemode', when I exceed some like 10 lines, it gives error in Compiling.
Here is a little of the Factions Table.
pawn Код:
mysql_function_query(handle, "CREATE TABLE IF NOT EXISTS `factions` ( \
`Rank1` varchar(50) NOT NULL, \
`Rank2` varchar(50) NOT NULL, \
`Rank3` varchar(50) NOT NULL, \
`Rank4` varchar(50) NOT NULL, \
`Rank5` varchar(50) NOT NULL, \
`Rank6` varchar(50) NOT NULL, \
`Rank7` varchar(50) NOT NULL, \
`Skin0` int(11) NOT NULL DEFAULT '0', \
.... and so on.
And I get this error when I exceed a Specific lines in the Tables. Let's say, if I add
pawn Код:
`Skin1` int(11) NOT NULL DEFAULT '0', \
After Skin 0, It gives that error. When I remove 'one' line. Any could it be, Rank5 for Instance. It'd work fine.
Re: Tables Help [MYSQL] -
Lordzy - 02.01.2015
There's length limit on pawno processor, all you can do is split them up and merge. (Hint :
Declare multiple arrays, use strcat then to concatenate them. EDIT : Simply use strins to insert the rest query.)
PS : Those "Rank1", "Rank2", ... "Rank7" is a bad way of creating fields. Try reading this tutorial, it might help you improve the way of creating tables -
https://sampforum.blast.hk/showthread.php?tid=420363
Re: Tables Help [MYSQL] -
Dignity - 02.01.2015
Use this pawn compiler:
https://sampforum.blast.hk/showthread.php?pid=2768123#pid2768123
Re: Tables Help [MYSQL] -
JonathanW - 02.01.2015
Quote:
Originally Posted by Lordzy
There's length limit on pawno processor, all you can do is split them up and merge. (Hint : Declare multiple arrays, use strcat then to concatenate them.)
PS : Those "Rank1", "Rank2", ... "Rank7" is a bad way of creating fields. Try reading this tutorial, it might help you improve the way of creating tables - https://sampforum.blast.hk/showthread.php?tid=420363
|
Got it. Thank you Kind sir.
Quote:
Originally Posted by Mionee
|
I downloaded it, and it worked! May God bless you.