SA-MP Forums Archive
MYSQL Problem - 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 Problem (/showthread.php?tid=617945)



MYSQL - ErrorID: 1064 You have an error in your SQL syntax - Swarn - 28.09.2016

I got a problem where the account settings, money, cars, guns etc do not save when they leave the server, I cannot find a fix and this is a big problem. Any ideas?

Will drop codes if needed, rep will be added.

Edit;
this is what I have got at the minute;
Код:
(28/9/2016) ErrorID: 1064
(28/9/2016) Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for t
(28/9/2016) Query: UPDATE samp_users SET `Password`='195625701', Level='199', Pos_x='1595.58', Pos_y='-2329.42', Pos_z='13.53',
(28/9/2016) Callback: OnQueryFinish



Re: MYSQL Problem - Rdx - 28.09.2016

Probably you need to increase string. I can't tell more without code.


Re: MYSQL Problem - Swarn - 28.09.2016

What code do you think you'll need?


Re: MYSQL Problem - Kaliber - 29.09.2016

Search in your script for this query:
PHP код:
UPDATE samp_users SET `Password
And post the full query


Re: MYSQL Problem - Swarn - 29.09.2016

Код:
format(sql, sizeof(sql), "UPDATE samp_users SET `Password`='%d', Level='%d', Pos_x='%.2f', Pos_y='%.2f', Pos_z='%.2f', RegularRank='%d', UpgradePoints='%d'", PlayerInfo[playerid][pKey], PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pRegularRank], PlayerInfo[playerid][gPupgrade]);



Re: MYSQL Problem - oMa37 - 29.09.2016

PHP код:
UPDATE `samp_usersSET `Password` = %d, `Level` = %d, `Pos_x` = %.2f, `Pos_y` = %.2f, `Pos_z` = %.2f, `RegularRank` = %d, `UpgradePoints` = %
Should work.
btw if the password for players accounts, save it as string.


Re: MYSQL Problem - Swarn - 29.09.2016

Quote:
Originally Posted by oMa37
Посмотреть сообщение
PHP код:
UPDATE `samp_usersSET `Password` = %d, `Level` = %d, `Pos_x` = %.2f, `Pos_y` = %.2f, `Pos_z` = %.2f, `RegularRank` = %d, `UpgradePoints` = %
Should work.
btw if the password for players accounts, save it as string.
Didn't work


Re: MYSQL Problem - Tass007 - 30.09.2016

Removed.


Re: MYSQL Problem - DTV - 30.09.2016

Um, is that the actual code that saves the player's account on disconnect? If so, you have a major issue not specifying which player to save. The way that code would work is when someone disconnects, everyone in the server will have their stats set to the last player that disconnected.


Re: MYSQL Problem - Rdx - 30.09.2016

Quote:
Originally Posted by Swarn
Посмотреть сообщение
Код:
format(sql, sizeof(sql), "UPDATE samp_users SET `Password`='%d', Level='%d', Pos_x='%.2f', Pos_y='%.2f', Pos_z='%.2f', RegularRank='%d', UpgradePoints='%d'", PlayerInfo[playerid][pKey], PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pRegularRank], PlayerInfo[playerid][gPupgrade]);
What is size of "sql" array? Look for new sql[size].