SA-MP Forums Archive
Mysql Error 1064 Help needed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql Error 1064 Help needed (/showthread.php?tid=369024)



Mysql Error 1064 Help needed - demonarn - 15.08.2012

Hello ,

I`ve looked at the problem already and couldn`t find the source of the error .

pawn Код:
[15:11:15] Error #1064 - 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 | Query: UPDATE players SET Health = '100.000000', Armour = '0.000000', PosX = '1781.441162', PosY = '1966.091064', PosZ = '5.328877', PosR = '296.922332', Interior = 0, Skin = 147, Admin = 1, Team = 0, Infected = 0, Rations = 0, Radio = 0, Mask = 0, Cuffs = 0, Blindfold = 0, Radioused = 0, Maskused = 0, Watchused = 0, Watch = 0, Armor = 0, Bandage = 0, Medicine = 4 WHERE ID =
Can anyone see the problem ?

If you need more info just ask .


Re: Mysql Error 1064 Help needed - [DOG]irinel1996 - 15.08.2012

Where did you get that error?
Console, compiler, web?

Also, don't use ' ' for numbers, just for strings.


Re: Mysql Error 1064 Help needed - demonarn - 15.08.2012

Console and its a string


Re: Mysql Error 1064 Help needed - [DOG]irinel1996 - 15.08.2012

Give me the line.


Re: Mysql Error 1064 Help needed - demonarn - 15.08.2012

pawn Код:
format(szQuery, sizeof(szQuery), "UPDATE players SET Health = '%f', Armour = '%f', PosX = '%f', PosY = '%f', PosZ = '%f', PosR = '%f'", playerVariables[playerid][pHealth], playerVariables[playerid][pArmour], playerVariables[playerid][pPos][0], playerVariables[playerid][pPos][1], playerVariables[playerid][pPos][2], playerVariables[playerid][pPos][3]);
    format(szQuery, sizeof(szQuery), "%s, Interior = %d, Skin = %d, Admin = %d, Team = %d, Infected = %d, Rations = %d, Radio = %d, Mask = %d, Cuffs = %d, Blindfold = %d, Radioused = %d, Maskused = %d, Watchused = %d, Watch = %d, Armor = %d, Bandage = %d, Medicine = %d, First = %d WHERE ID = %d",szQuery,
    playerVariables[playerid][pInterior], playerVariables[playerid][pSkin], playerVariables[playerid][pAdmin], playerVariables[playerid][pTeam], playerVariables[playerid][pInfected],  playerVariables[playerid][pRations], playerVariables[playerid][pRadio],  playerVariables[playerid][pMask], playerVariables[playerid][pCuffs], playerVariables[playerid][pBlindfold], playerVariables[playerid][pRadioused],
    playerVariables[playerid][pWatchused], playerVariables[playerid][pWatch], playerVariables[playerid][pArmor], playerVariables[playerid][pBandage], playerVariables[playerid][pMedicine], playerVariables[playerid][pFirst], playerVariables[playerid][pDBID]);
    mysql_query(szQuery, THREAD_NO_RESULT, playerid, iConnectionHandle);



Re: Mysql Error 1064 Help needed - playbox12 - 15.08.2012

WHERE ID = it cuts of right there, so try increasing the size of your szQuery.


Re: Mysql Error 1064 Help needed - demonarn - 15.08.2012

Did increase the size it didnt work ;(


Re: Mysql Error 1064 Help needed - SuperViper - 15.08.2012

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
Where did you get that error?
Console, compiler, web?

Also, don't use ' ' for numbers, just for strings.
' ' can be used on numbers to better organize your query. Some people enjoy making their script look better.


Re: Mysql Error 1064 Help needed - demonarn - 15.08.2012

Tried deleting them to it didnt help