Mysql unknown error -
IndependentGaming - 04.05.2015
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 ?
Re: Mysql unknown error -
Smileys - 04.05.2015
your query doesn't seem to have an "WHERE ID = ??", there's no ID specified.
Re: Mysql unknown error -
IndependentGaming - 04.05.2015
Like what it is in the DB ID
Re: Mysql unknown error -
PowerPC603 - 04.05.2015
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");
Re: Mysql unknown error -
IndependentGaming - 04.05.2015
The problem has been solved thanks to PowerPC603 indeed, it was new query[180];
i changed it to new query[2000];
Re: Mysql unknown error -
sammp - 04.05.2015
WHERE `ID` = "
No ID displayed either