line is big
#1

this is the error
pawn Код:
C:\Documents and Settings\user\My Documents\Downloads\0.3e\gamemodes\mysql.pwn(3597) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\user\My Documents\Downloads\0.3e\gamemodes\mysql.pwn(3597) : error 017: undefined symbol "CREATE"
C:\Documents and Settings\user\My Documents\Downloads\0.3e\gamemodes\mysql.pwn(3597) : error 017: undefined symbol "TABLE"
C:\Documents and Settings\user\My Documents\Downloads\0.3e\gamemodes\mysql.pwn(3597) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

line
pawn Код:
mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(40), registered INT(20), loggedin INT(20), Rb INT(20), Unlimitedb INT(20), Quickweapon INT(20), Vgoto INT(20), PlayerFly INT(20), TP INT(20), Function1 INT(20), Function2 INT(20), Function3 INT(20), Function4 INT(20), Function5 INT(20), Cookies INT(20), Cakes INT(20), Biscuits INT(20), IceCreams INT(20),level INT(20), LastOn VARCHAR(15), money INT(20), kills INT(20), deaths INT(20), Bank INT(20), weed INT(20))");
This is the code putting under OnGamemodeinit for mysql

How to fix that error? help
Reply
#2

You need the MySQL Plugin.
Reply
#3

add "a_mysql" include
Reply
#4

I already done, now the problem is that line is too big.How to fix it?
Reply
#5

The error is
pawn Код:
invalid string (possibly non-terminated string)
It is because the line is too long

pawn Код:
mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(40), registered INT(20), loggedin INT(20), Rb INT(20), Unlimitedb INT(20), Quickweapon INT(20), Vgoto INT(20), PlayerFly INT(20), TP INT(20), Function1 INT(20), Function2 INT(20), Function3 INT(20), Function4 INT(20), Function5 INT(20), Cookies INT(20), Cakes INT(20), Biscuits INT(20), IceCreams INT(20),level INT(20), LastOn VARCHAR(15), money INT(20), kills INT(20), deaths INT(20), Bank INT(20), weed INT(20))");
How can i fix it? like \n something like that is there right??
Please tell me how...
Reply
#6

is this correct?

pawn Код:
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
    mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(40), score INT(20), money INT(20), level INT(20), vip INT(20), kma INT(20), rank INT(20), kills INT(20), deaths INT(20), muted INT(20), jailed INT(20), frozen INT(20), mutedtimes INT(20), jailedtimes INT(20), frozentimes INT(20), banned INT(20), bannedby VARCHAR(24), logins INT(20)");
    mysql_query("CREATE TABLE IF NOT EXISTS playerdata(posx INT(20), posy INT(20), posz INT(20), posa INT(20), IP VARCHAR(15), posd INT(20)), pose INT(20), posf INT(20), posg INT(20), posh INT(20)");
    mysql_debug(1);
I mean 2 mysql_query..
Reply
#7

Quote:
Originally Posted by P<3TS
Посмотреть сообщение
is this correct?

pawn Код:
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
    mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(40), score INT(20), money INT(20), level INT(20), vip INT(20), kma INT(20), rank INT(20), kills INT(20), deaths INT(20), muted INT(20), jailed INT(20), frozen INT(20), mutedtimes INT(20), jailedtimes INT(20), frozentimes INT(20), banned INT(20), bannedby VARCHAR(24), logins INT(20)");
    mysql_query("CREATE TABLE IF NOT EXISTS playerdata(posx INT(20), posy INT(20), posz INT(20), posa INT(20), IP VARCHAR(15), posd INT(20)), pose INT(20), posf INT(20), posg INT(20), posh INT(20)");
    mysql_debug(1);
I mean 2 mysql_query..
i dont think because in the first line you checked it and Create the table
and in the scond line the table was CREADED because of the first line

you can use strcat..
Reply
#8

I created two because it shows the line is too big and i want everything in 1 line.Any solution for that?
And what is strcat?
Reply
#9

this ?

pawn Код:
strcat(string, "\n", 1900 );
    strcat(string, "\n", 1900 );
    strcat(string, "\n", 1900 );
    strcat(string, "\n", 1900 );
    strcat(string, "\n", 1900 );
If yes then how can i make mysql_query functions into it?
Reply
#10

i show you

Код:
new string[500];
strcat(string, "CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(40), registered INT(20), loggedin INT(20), Rb INT(20), Unlimitedb INT(20), Quickweapon INT(20), Vgoto INT(20), PlayerFly INT(20), TP INT(20), Function1 INT(20),");
strcat(string. " Function2 INT(20), Function3 INT(20), Function4 INT(20), Function5 INT(20), Cookies INT(20), Cakes INT(20), Biscuits INT(20), IceCreams INT(20),level INT(20), LastOn VARCHAR(15), money INT(20), kills INT(20), deaths INT(20), Bank INT(20), weed INT(20))");
mysql_query(string);
hope i help you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)