SA-MP Forums Archive
[3]Mysql problem ? - 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: [3]Mysql problem ? (/showthread.php?tid=486991)



[3]Mysql problem ? - anou1 - 11.01.2014

Hi guys, I got a problem when I add a line after Skin it always shows me this:

Beta.pwn(100) : error 075: input line too long (after substitutions)
Beta.pwn(101) : error 037: invalid string (possibly non-terminated string)
Beta.pwn(102) : error 037: invalid string (possibly non-terminated string)
Beta.pwn(102) : warning 215: expression has no effect
Beta.pwn(102) : error 001: expected token: ";", but found ")"
Beta.pwn(102) : error 029: invalid expression, assumed zero
Beta.pwn(102) : fatal error 107: too many error messages on one line


Код:
public OnGameModeInit()
{
	SetGameModeText("Apprend A script");
	mysql_debug(1); //Let's enable debugging so we can detect a problem(if there is)
    mysql = mysql_connect(host, user, db, pass); //This function will connect your server to database. Remember we have defined our host, username, database and password. It's time to use it here.
    if(mysql_errno(mysql) != 0) print(" Erreur de connexion a la BDD !"); //This will tell if your connection to database is successful or not. If it's not, check your host, username, database and password. Make sure they all right.
    
    //If we're cool, it's time to create a table for your database.
    mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `joueurs`(\
                        `ID` int(10) NOT NULL AUTO_INCREMENT, \
                        `Username` varchar(24) NOT NULL, \
                        `Password` varchar(129) NOT NULL, \
                        `IP` varchar(16) NOT NULL, \
                        `Admin` int(10) NOT NULL, \
                        `VIP` int(10) NOT NULL, \
                        `Argent` int(10) NOT NULL, \
                        `posX` float NOT NULL, \
                        `posY` float NOT NULL, \
                        `posZ` float NOT NULL, \
			`Interieur` int(11) NOT NULL, \
			`World` int(11) NOT NULL, \
			`Skin` int(10) NOT NULL, \
			`Niveau` int(10) NOT NULL, \
                        PRIMARY KEY (`ID`))", "", "");
             return 1;
}
If I just delete the line " `Niveau` int(10) NOT NULL, \"
All work fine


Should I separe my tquery in 2 parts ?


Re: [3]Mysql problem ? - anou1 - 11.01.2014

BUMP


Re: [3]Mysql problem ? - anou1 - 11.01.2014

12/01

UP


Re: [3]Mysql problem ? - anou1 - 12.01.2014

Help please


Re: [3]Mysql problem ? - newbie scripter - 12.01.2014

pawn Код:
mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `joueurs`(
                        `ID` int(10) NOT NULL AUTO_INCREMENT, `Username` varchar(24) NOT NULL, `Password` varchar(129) NOT NULL, \
                        `IP` varchar(16) NOT NULL, `Admin` int(10) NOT NULL, `VIP` int(10) NOT NULL, \
                        `Argent` int(10) NOT NULL, `posX` float NOT NULL, `posY` float NOT NULL, \
                        `posZ` float NOT NULL, `Interieur` int(11) NOT NULL, `World` int(11) NOT NULL, \
                        `Skin` int(10) NOT NULL, `Niveau` int(10) NOT NULL, PRIMARY KEY (`ID`))"
, "", "");



Re: [3]Mysql problem ? - Jefff - 12.01.2014

pawn Код:
new str[500];
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, \
`Admin` int(10) NOT NULL, \
`VIP` int(10) NOT NULL, \
`Argent` int(10) NOT NULL,"
;

strcat(str,"`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, \
`Niveau` int(10) NOT NULL, \
PRIMARY KEY (`ID`))"
);

printf("CREATE TABLE LEN: %d",strlen(str));

mysql_tquery(mysql, str, "", "");



Re: [3]Mysql problem ? - anou1 - 12.01.2014

Thank you guy, problem solved with ur help !