Mysql unknown error
#1

Hello, i working on a deathmatch script on mysql the only problem is now when i log off (test server)

then i shows me a mysql error in my console

Код:
[00:51:19] [MYSQL] Error: Query: "UPDATE `playerdata` SET `Banned` = 0, `Reg` = 1, `Admin` = 0, `Score` = 0, `Money` = 0, `Kills` = 1000, `Deaths` = 0, `Premium` = 0, `Helper` = 0, `IP` = '127.0.0.1' WHERE `ID` = " Error: "You have an error in your SQL syntax; check t
Does anyone have any idea ?
Reply
#2

your query doesn't seem to have an "WHERE ID = ??", there's no ID specified.
Reply
#3

Like what it is in the DB ID
Reply
#4

Is your query string large enough to hold the entire query?
Your posted query takes up 180 characters, and you should fill out your query to hold the maximum amount of characters possible anytime like this:
Код:
UPDATE `playerdata` SET `Banned` = 0, `Reg` = 1, `Admin` = 0, `Score` = 1234567890, `Money` = 1234567890, `Kills` = 1234567890, `Deaths` = 1234567890, `Premium` = 0, `Helper` = 0, `IP` = '127.0.0.1' WHERE `ID` = 1234567890
I'm always using 1234567890 to fill out an integer value as integers usually take up 10 characters (max value 2.1 billion), so this gives you a query length of 223 characters.
Take a few more for the added "0" character to terminate the string and possibly a added minus sign for your ints and create a query variable of size 256, that should be big enough.

pawn Код:
new query[256];
format(query, sizeof(query), "UPDATE `playerdata` SET `Banned` = 0, `Reg` = 1, `Admin` = 0, `Score` = 1234567890, `Money` = 1234567890, `Kills` = 1234567890, `Deaths` = 1234567890, `Premium` = 0, `Helper` = 0, `IP` = '127.0.0.1' WHERE `ID` = 1234567890");
Reply
#5

The problem has been solved thanks to PowerPC603 indeed, it was new query[180];
i changed it to new query[2000];
Reply
#6

WHERE `ID` = "

No ID displayed either
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)