[3]Mysql problem ?
#1

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

BUMP
Reply
#3

12/01

UP
Reply
#4

Help please
Reply
#5

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`))"
, "", "");
Reply
#6

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, "", "");
Reply
#7

Thank you guy, problem solved with ur help !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)