error 075: input line too long
#1

Hey guys,

I just started a new GM and now Iґm learning a bit of MySQL.
I was reading a Tutorial and tried to do it by myself, with my own variables.

But to register a player Iґve gotta set many Variables and that seems to be too much for Pawn

How Can I fix it?

Errors:

Quote:

C:\PeMfr\gamemodes\sat.pwn(49 : error 075: input line too long (after substitutions)
C:\PeMfr\gamemodes\sat.pwn(499) : error 037: invalid string (possibly non-terminated string)
C:\PeMfr\gamemodes\sat.pwn(499) : error 017: undefined symbol "INSERT"
C:\PeMfr\gamemodes\sat.pwn(499) : error 017: undefined symbol "INTO"
C:\PeMfr\gamemodes\sat.pwn(499) : fatal error 107: too many error messages on one line

Line:

PHP код:
            mysql_format(mysqlquerysizeof(query), "INSERT INTO `accounts` (`Name`, `Password`, `SkinID`, `Class`, `Money`, `Bank`, `Score` ,`Kills`, `Deaths`, `MissionsCompleted`, `Level`, `EXP`, `Adminlevel`, `VIP`, `TotalVehicles`, `WeaponSlot1`, `WeaponSlot2`, `WeaponSlot3`, `WeaponAmmo1`, `WeaponAmmo2`, `WeaponAmmo3`, `PosX`, `PosY`, `PosZ`, `FacingAngel`, `Bountie`, `BountiesDone`, `TroublesMade`, `Headshots`) VALUES ('%e', '%s','%s', 299, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ,0 ,0, 0 ,0 ,0, 0 ,0 ,0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0)"Name[playerid], pInfo[playerid][Password], IP[playerid]); 
Reply
#2

set default values in the database. Saves writing 0 all the time. Default values applies for stuff like score,money,admin etc. Not username, or password
Reply
#3

Your insert query is already is 483 characters, that's without the values yet. Make the size of your query variable bigger.

Example:
pawn Код:
new query[1000];
Reply
#4

Quote:
Originally Posted by Eyce
Посмотреть сообщение
Your insert query is already is 483 characters, that's without the values yet. Make the size of your query variable bigger.

Example:
pawn Код:
new query[1000];
This didnt really helped, Iґll try it with default values will give you a feedback if It could fix it

Thanks anyways
Reply
#5

Quote:
Originally Posted by Saize
Посмотреть сообщение
This didnt really helped, Iґll try it with default values will give you a feedback if It could fix it

Thanks anyways
Oh yeah, you could always set the default values on your tables. But if you still prefer your code above, you could cut them into two queries.
Reply
#6

Quote:
Originally Posted by Eyce
Посмотреть сообщение
Oh yeah, you could always set the default values on your tables. But if you still prefer your code above, you could cut them into two queries.
Seems like it fixxed the Problem.

If I want to set a Value to 0 cant I simply use "NULL" ?
Reply
#7

You can do something like this if you have a database structure on an SQL or text file:
Код:
CREATE TABLE IF NOT EXISTS `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
...
`weapon` int(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT = 1;
Reply
#8

Quote:
Originally Posted by Eyce
Посмотреть сообщение
You can do something like this if you have a database structure on an SQL or text file:
Код:
CREATE TABLE IF NOT EXISTS `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
...
`weapon` int(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT = 1;
Thanks mate +Rep
Reply
#9

You're most welcome.
Reply
#10

Quote:
Originally Posted by Saize
Посмотреть сообщение
Seems like it fixxed the Problem.

If I want to set a Value to 0 cant I simply use "NULL" ?
Null isn't equal to zero. Null isn't even equal to itself. Null means "nothing" or "I don't know" and you can't compare nothing with nothing.
Reply


Forum Jump:


Users browsing this thread: 10 Guest(s)