Failing Query - R7
#1

Before R7, these queries worked.

Now, I get this:
Код:
[02:39:31] Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
[02:39:31] ErrorID: 1064
I really don't get what changed on the latest plugin to stop these long queries from working.
Код:
UPDATE `properties` SET X = `%f`, Y = `%f`, Z = `%f`, eX = `%f`, eY = `%f`, eZ = `%f`, Owner = %s, Description = %s, \
		Cost = %d, Hel = %d, Arm = %d, Int = %d, Lock = %d, Owned = %d, Rooms = %d, Rent = %d, Rentabil = %d, \
		Takings = %d, Date = %d, Level = %d, World = %d, OutWorld = %d, OutInt = %d, OTaken = %d, Clothes = %d, \
		Clothes2 = %d, Clothes3 = %d, Safe = %d, Radio = %d, Station = %d, TV = %d WHERE ID = %d
That is currently what I have for my query..
Reply
#2

Код:
UPDATE `properties` SET `X` = '%f', `Y` = '%f', `Z` = '%f', `eX` = '%f', `eY` = '%f', `eZ` = '%f', `Owner` = '%s', `Description` = '%s', \
		`Cost` = '%d', `Hel` = '%d', `Arm` = '%d', `Int` = '%d', `Lock` = '%d', `Owned` = '%d', `Rooms` = '%d', `Rent` = '%d', `Rentabil` = '%d', \
		`Takings` = '%d', `Date` = '%d', `Level` = '%d', `World` = '%d', `OutWorld` = '%d', `OutInt` = '%d', `OTaken` = '%d', `Clothes` = '%d', \
		`Clothes2` = '%d', `Clothes3` = '%d', `Safe` = '%d', `Radio` = '%d', `Station` = '%d' AND `TV` = '%d' WHERE `ID` = '%d'
Try that.
Reply
#3

Quote:
Originally Posted by Kikito
Посмотреть сообщение
Код:
UPDATE `properties` SET `X` = '%f', `Y` = '%f', `Z` = '%f', `eX` = '%f', `eY` = '%f', `eZ` = '%f', `Owner` = '%s', `Description` = '%s', \
		`Cost` = '%d', `Hel` = '%d', `Arm` = '%d', `Int` = '%d', `Lock` = '%d', `Owned` = '%d', `Rooms` = '%d', `Rent` = '%d', `Rentabil` = '%d', \
		`Takings` = '%d', `Date` = '%d', `Level` = '%d', `World` = '%d', `OutWorld` = '%d', `OutInt` = '%d', `OTaken` = '%d', `Clothes` = '%d', \
		`Clothes2` = '%d', `Clothes3` = '%d', `Safe` = '%d', `Radio` = '%d', `Station` = '%d' AND `TV` = '%d' WHERE `ID` = '%d'
Try that.
You only use single quotes on strings!!!!
Reply
#4

You're using the graves incorrectly. Doing so can cause SQL errors.

pawn Код:
Y = `%f`
You're doing it the complete opposite way. It should be:

pawn Код:
`Y` = %f
However, you either have to surround each field (i.e. "Y") in graves, or just not use them at all. I like using them for clarity, but it's completely up to you as it's your code.
Reply
#5

I've tried without graving (which is my normal way), still no difference. Why is that long queries fail to work. My saving for player accounts has similar coding, but it works fine...
Reply
#6

Split the query up.
Reply
#7

It's because the lenght of the string is not large enough to store it and it cuts it, so it will give syntax error.

By the way
pawn Код:
// An example about '':
"UPDATE `something` SET integer = %d, float = %f, string = '%s' WHERE ID = 0"
Reply
#8

Look into the mysql log and show us the final query.

Also, I recommend you to use MySQL R8 ****** Code.
Reply
#9

Quote:
Originally Posted by IstuntmanI
Посмотреть сообщение
Look into the mysql log and show us the final query.

Also, I recommend you to use MySQL R8 ****** Code.
R20 is much faster, but R8 is an improvement of course.
Reply
#10

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
It's because the lenght of the string is not large enough to store it and it cuts it, so it will give syntax error.

By the way
pawn Код:
// An example about '':
"UPDATE `something` SET integer = %d, float = %f, string = '%s' WHERE ID = 0"
Yep clumsy me.

I am using MySQL R7 REV 20

EDIT: Infact, that did not fix it. I'll ty RealCop's splitting input.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)