[Mysql] Is that too long ? -
anou1 - 21.02.2014
Hi,
My code is:
Код:
new str[2048];
str = "CREATE TABLE IF NOT EXISTS `joueurs`(\
`ID` int(10) NOT NULL AUTO_INCREMENT, \
`Username` varchar(24) NOT NULL, \
`Password` varchar(128) NOT NULL, \
`IP` varchar(16) NOT NULL, \
`DerniereIP` varchar(16) NOT NULL, \
`Admin` int(10) NOT NULL, \
`VIP` int(10) NOT NULL, \
`Argent` int(10) NOT NULL,\
`Banque` int(10) NOT NULL, \
`posX` float NOT NULL, \
`posY` float NOT NULL, \
`posZ` float NOT NULL, \
`Interieur` smallint(5) UNSIGNED NOT NULL, \
`World` smallint(5) UNSIGNED NOT NULL, \
`Skin` smallint(3) UNSIGNED NOT NULL, ";
strcat(str,"`Niveau` int(10) NOT NULL, \
`DateInscription` varchar(24) NOT NULL, \
`Bannis` int(10) NOT NULL, \
`RaisonBan` varchar(128) NOT NULL, \
`BannisPar` varchar(24) NOT NULL, \
`Vie` float NOT NULL, \
`Armure` float NOT NULL, \
`MinutesJouees` int(10) NOT NULL, \
`HeuresJouees` int(10) NOT NULL, \
`JoursJoues` int(10) NOT NULL, \
`Prison` int(10) NOT NULL, \
`TempsPrison` int(10) NOT NULL, \
`Tues` int(10) NOT NULL, \
`Morts int(10) NOT NULL, \
`Arme1` int(10) NOT NULL, \
`Munitions1` int(10) NOT NULL, \
`Arme2` int(10) NOT NULL, \
`Munition2` int(10) NOT NULL, \
`Arme3` int(10) NOT NULL, \
`Munition3` int(10) NOT NULL, \
`Arme4` int(10) NOT NULL, \
`Munition4` int(10) NOT NULL, \
PRIMARY KEY (`ID`))");
But I got errors:
Код:
Beta.pwn(287) : error 075: input line too long (after substitutions)
Beta.pwn(288) : error 037: invalid string (possibly non-terminated string)
Beta.pwn(288) : error 017: undefined symbol "CREATE"
Beta.pwn(288) : error 017: undefined symbol "TABLE"
Beta.pwn(288) : fatal error 107: too many error messages on one line
Line 286:" `Interieur` smallint(5) UNSIGNED NOT NULL, \ "
Line 287:" `World` smallint(5) UNSIGNED NOT NULL, \ "
Line 288:" `Skin` smallint(3) UNSIGNED NOT NULL, "; "
Do any of you have a idea for this ?
Re: [Mysql] Is that too long ? -
Mriss - 21.02.2014
make the whole MySQL query thing into a text document and rename it to sql.sql, then goto phpmyadmin and upload there... If you need help I can make a video for you., Please +Rep me if I helped
Re: [Mysql] Is that too long ? -
Mriss - 21.02.2014
Or I Can use teamviewer to help you
Re: [Mysql] Is that too long ? -
PowerPC603 - 21.02.2014
You've already split up your query and joined it back together with strcat.
Just use more strcat lines to split it up even more.
Re : [Mysql] Is that too long ? -
anou1 - 21.02.2014
Thank you guy it worked
Re : [Mysql] Is that too long ? -
anou1 - 21.02.2014
Код:
new str[2048];
str = "CREATE TABLE IF NOT EXISTS `joueurs`(\
`ID` int(10) NOT NULL AUTO_INCREMENT, \
`Username` varchar(24) NOT NULL, \
`Password` varchar(128) NOT NULL, \
`IP` varchar(16) NOT NULL, \
`DerniereIP` varchar(16) NOT NULL, \
`Admin` int(10) NOT NULL, \
`VIP` int(10) NOT NULL, \
`Argent` int(10) NOT NULL,\
`Banque` int(10) NOT NULL, \
`posX` float NOT NULL, \
`posY` float NOT NULL, \
`posZ` float NOT NULL, \
`Interieur` smallint(5) UNSIGNED NOT NULL, \
`World` smallint(5) UNSIGNED NOT NULL, ";
strcat(str,"`Skin` smallint(3) UNSIGNED NOT NULL, \
`Niveau` int(10) NOT NULL, \
`DateInscription` varchar(24) NOT NULL, \
`Bannis` int(10) NOT NULL, \
`RaisonBan` varchar(128) NOT NULL, \
`BannisPar` varchar(24) NOT NULL, \
`Vie` float NOT NULL, \
`Armure` float NOT NULL, \
`MinutesJouees` int(10) NOT NULL, \
`HeuresJouees` int(10) NOT NULL, \
`JoursJoues` int(10) NOT NULL, \
`Prison` int(10) NOT NULL, \
`TempsPrison` int(10) NOT NULL, \
`Tues` int(10) NOT NULL, \
`Morts int(10) NOT NULL, ");
strcat(str,"`Arme1` int(10) NOT NULL, \
`Munition1` int(10) NOT NULL, \
`Arme2` int(10) NOT NULL, \
`Munition2` int(10) NOT NULL, \
`Arme3` int(10) NOT NULL, \
`Munition3` int(10) NOT NULL, \
`Arme4` int(10) NOT NULL, \
`Munition4` int(10) NOT NULL, \
PRIMARY KEY (`ID`))");
mysql_tquery(mysql, str, "", "");
Sorry for the double post, but I tried this and It's not creating the table in the database.
Should I create "str2" then add to this str the first one ? Or something else ?
Thank you
Re: [Mysql] Is that too long ? -
Smally - 21.02.2014
Correct me if I'm wrong, but shouldn't it be the following.
pawn Код:
new str[2048];
str = "CREATE TABLE IF NOT EXISTS `joueurs`(\
`ID` int(10) NOT NULL AUTO_INCREMENT, \
`Username` varchar(24) NOT NULL, \
`Password` varchar(128) NOT NULL, \
`IP` varchar(16) NOT NULL, \
`DerniereIP` varchar(16) NOT NULL, \
`Admin` int(10) NOT NULL, \
`VIP` int(10) NOT NULL, \
`Argent` int(10) NOT NULL,\
`Banque` int(10) NOT NULL, \
`posX` float NOT NULL, \
`posY` float NOT NULL, \
`posZ` float NOT NULL, \
`Interieur` smallint(5) UNSIGNED NOT NULL, \
`World` smallint(5) UNSIGNED NOT NULL, ";
strcat(str,"`Skin` smallint(3) UNSIGNED NOT NULL, \
`Niveau` int(10) NOT NULL, \
`DateInscription` varchar(24) NOT NULL, \
`Bannis` int(10) NOT NULL, \
`RaisonBan` varchar(128) NOT NULL, \
`BannisPar` varchar(24) NOT NULL, \
`Vie` float NOT NULL, \
`Armure` float NOT NULL, \
`MinutesJouees` int(10) NOT NULL, \
`HeuresJouees` int(10) NOT NULL, \
`JoursJoues` int(10) NOT NULL, \
`Prison` int(10) NOT NULL, \
`TempsPrison` int(10) NOT NULL, \
`Tues` int(10) NOT NULL, \
`Morts int(10) NOT NULL, " sizeof(str));
strcat(str,"`Arme1` int(10) NOT NULL, \
`Munition1` int(10) NOT NULL, \
`Arme2` int(10) NOT NULL, \
`Munition2` int(10) NOT NULL, \
`Arme3` int(10) NOT NULL, \
`Munition3` int(10) NOT NULL, \
`Arme4` int(10) NOT NULL, \
`Munition4` int(10) NOT NULL, \
PRIMARY KEY (`ID`))", sizeof(str));
mysql_tquery(mysql, str, "", "");
Re : [Mysql] Is that too long ? -
anou1 - 21.02.2014
Thank you for your answer, I just noticed that I forgot a " ` " after "Morts".
That's why it wasnt working.
But now it's fine.
Thank you