MySQL insert stops in the middle
#6

Quote:
Originally Posted by bondowocopz
Посмотреть сообщение
I see there's some unescape string in this syntax.
Код:
1648.493,-1111.489,23.914,110.289
You need to add single quotes ' for string on mysql syntax.
those numbers are floats, not strings :P

Anyway, I've had this problem a numerous amount of times, and everytime it's the same thing, string exceeds character limit.

use this to check how many characters your query has.

Also, I recommend you to replace the "%f" and "%s" with the max amount of characters it COULD have when you paste it in that site, then add +5 or +10 chars to make sure you can't get an exploit there.

example: INSERT INTO Users ( name, password, adminlevel ) VALUES ( '%s', '%s', %i ); with params: xXxx_Swaglord_xXxX, you_cant_guess_this_password, 0

that would become:
INSERT INTO Users ( name, password, adminlevel ) VALUES ( 'xXxx_Swaglord_xXxX', 'you_cant_guess_this_password', 0 ); when executed.

when entering that string to the website I provided, you'll see it has more characters than when you just keep %s etc.

that string would have 116 characters, rounding it would come to approx 120 characters, so you'd do:
pawn Код:
new query[ 120 ]; // or 128, whatever you prefer aslong as it's 117 since the string has that size.
I usually go to this site after I've written a few queries just to make sure it can't get bugged, it took me a long time to find out that it was this when it happened to me the first time :P
Reply


Messages In This Thread
MySQL insert stops in the middle - by Zloto - 11.05.2015, 22:14
Re: MySQL insert stops in the middle - by Joe Staff - 11.05.2015, 23:27
Re: MySQL insert stops in the middle - by Zloto - 12.05.2015, 00:02
Re: MySQL insert stops in the middle - by Sithis - 12.05.2015, 08:34
Re: MySQL insert stops in the middle - by X337 - 12.05.2015, 11:54
Re: MySQL insert stops in the middle - by Smileys - 12.05.2015, 12:03

Forum Jump:


Users browsing this thread: 2 Guest(s)