Line too long
#1

why i cant fix this error? it says the line is too big
(38410) : error 075: input line too long (after substitutions)

pawn Код:
format(query, sizeof(query), "INSERT INTO data (user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto, playerfly, TP, YGFunction1, YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1) VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", pname, passwordstring, IP);
Reply
#2

I take it that you are not too familiar with MySQL. You shouldve set up the database with NOT NULL types and a DEFAULT value. That way you wouldn't have had to create such a big query.
Reply
#3

Try this
pawn Код:
format(query, sizeof(query), "INSERT INTO data (user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto, playerfly, TP, YGFunction1) VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)",pname,passwordstring,IP);
mysql_query(query);
format(query, sizeof(query), "INSERT INTO data (YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1) VALUES(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");
mysql_query(query);
Reply
#4

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
Try this
pawn Код:
format(query, sizeof(query), "INSERT INTO data (user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto, playerfly, TP, YGFunction1) VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)",pname,passwordstring,IP);
mysql_query(query);
format(query, sizeof(query), "INSERT INTO data (YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1) VALUES(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");
mysql_query(query);
Ok but when a player register then their name is registering in the database 2 times.
Why it is like that?
Reply
#5

Because you got two INSERT INTOs whilst the second should be an UPDATE.

Even so, change your database and set default values and you wont need such a long query
Reply
#6

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
Because you got two INSERT INTOs whilst the second should be an UPDATE.

Even so, change your database and set default values and you wont need such a long query
I didnt understand much, can you do that in this code ?

pawn Код:
format(query, sizeof(query), "INSERT INTO data (user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto, playerfly, TP, YGFunction1) VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)",pname,passwordstring,IP);
mysql_query(query);
format(query, sizeof(query), "INSERT INTO data (YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1) VALUES(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");
mysql_query(query);
Reply
#7

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
Try this
pawn Код:
format(query, sizeof(query), "INSERT INTO data (user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto, playerfly, TP, YGFunction1) VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)",pname,passwordstring,IP);
mysql_query(query);
format(query, sizeof(query), "INSERT INTO data (YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1) VALUES(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");
mysql_query(query);
that will make 2 accounts on database.

@crazyboobs,

try this

pawn Код:
new longstring[1000];

strcat(longstring, "(user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto,");
strcat(longstring, " playerfly, TP, YGFunction1, YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1)");

format(query, sizeof(query), "INSERT INTO data %s VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", longstring, pname, passwordstring, IP);
Reply
#8

Quote:
Originally Posted by kirollos
Посмотреть сообщение
that will make 2 accounts on database.

@crazyboobs,

try this

pawn Код:
new longstring[1000];

strcat(longstring, "(user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto,");
strcat(longstring, " playerfly, TP, YGFunction1, YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1)");

format(query, sizeof(query), "INSERT INTO data %s VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", longstring, pname, passwordstring, IP);
I did something like this

pawn Код:
format(query, sizeof(query), "INSERT INTO data (user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto, playerfly, TP, YGFunction1) VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)",pname,passwordstring,IP);
    mysql_query(query);
    format(query, sizeof(query), "UPDATE data (YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1) VALUES(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)");
    mysql_query(query);
and now its working fine and it may cause any problem?
Reply
#9

It is not working fine as that is not the way an UPDATE clause should be formatted, also it will update it on all accounts. GO FIX YOUR DATABASE SO YOU DONT HAVE TO CREATE THIS STUFF IN THE FIRST PLACE!

Want me to put it in even bigger letters? Go learn some database management first!
Reply
#10

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
It is not working fine as that is not the way an UPDATE clause should be formatted, also it will update it on all accounts. GO FIX YOUR DATABASE SO YOU DONT HAVE TO CREATE THIS STUFF IN THE FIRST PLACE!

Want me to put it in even bigger letters? Go learn some database management first!
What about this?
pawn Код:
new longstring[1000];

strcat(longstring, "(user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, YG, unlimitedb, quickweapon, vgoto,");
strcat(longstring, " playerfly, TP, YGFunction1, YGFunction2, YGFunction3, YGFunction4, YGFunction5, YGFunction6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, x1, y1, z1, interior1)");

format(query, sizeof(query), "INSERT INTO data %s VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", longstring, pname, passwordstring, IP);
And as you said' GO FIX YOUR DATABASE SO YOU DONT HAVE TO CREATE THIS STUFF IN THE FIRST PLACE!'
What i have to fix in database?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)