SA-MP Forums Archive
MySQL position saving - 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 position saving (/showthread.php?tid=302842)



MySQL position saving - vent - 10.12.2011

Well, i need help with my position saving system. The code is here:
CODE REMOVED!
The problem is that it wont update the information in the db.


Re: MySQL position saving - Scenario - 10.12.2011

Check your MySQL log.


Re: MySQL position saving - vent - 10.12.2011

For that i have to do mysql_debug(1); ?


Re: MySQL position saving - Scenario - 10.12.2011

Yes.


Re: MySQL position saving - vent - 10.12.2011

Did that but where the log saves?
edit:
Код:
[22:07:57] CMySQLHandler::Query(UPDATE `kasutajainfo` SET `mangutunde` = 0, `raha` = 0, `Last Pos X` = -1413.048461, `Last Pos Y` = 2616.027099, `Last Pos Z` = 55.835937, WHERE kasutaja='Sander_Koksaja') - An error has occured. (Error ID: 1064, 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 'WHERE kasutaja='Sander_Koksaja'' at line 1)



Re: MySQL position saving - T0pAz - 10.12.2011

Quote:
Originally Posted by vent
Посмотреть сообщение
Did that but where the log saves?
use mysql_debug(1); on OnGameModeInit then go in game, quit game and give us the mysql log


Edit:

Replace this
pawn Код:
format(query, sizeof(query), "UPDATE `kasutajainfo` SET `mangutunde` = %d, `raha` = %d, `Last Pos X` = %f, `Last Pos Y` = %f, `Last Pos Z` = %f, WHERE kasutaja='%s'", GetPlayerScore(playerid), GetPlayerMoney(playerid), x, y, z, pname);
with
pawn Код:
format(query, sizeof(query), "UPDATE `kasutajainfo` SET `mangutunde` = %d, `raha` = %d, `Last Pos X` = %f, `Last Pos Y` = %f, `Last Pos Z` = %f WHERE kasutaja='%s'", GetPlayerScore(playerid), GetPlayerMoney(playerid), x, y, z, pname);



Re: MySQL position saving - Scenario - 10.12.2011

It can be found in the server's root folder. Search for a file called mysql_log.txt and it'll all be in there.

EDIT:

pawn Код:
`Last Pos Z` = %f, WHERE
Remove the comma ( , ).

pawn Код:
`Last Pos Z` = %f WHERE



Re: MySQL position saving - vent - 10.12.2011

Код:
[22:07:57] CMySQLHandler::Query(UPDATE `kasutajainfo` SET `mangutunde` = 0, `raha` = 0, `Last Pos X` = -1413.048461, `Last Pos Y` = 2616.027099, `Last Pos Z` = 55.835937, WHERE kasutaja='Sander_Koksaja') - An error has occured. (Error ID: 1064, 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 'WHERE kasutaja='Sander_Koksaja'' at line 1)
There you go.


Re: MySQL position saving - Scenario - 10.12.2011

pawn Код:
`Last Pos Z` = %f, WHERE
Remove the comma ( , ).

pawn Код:
`Last Pos Z` = %f WHERE



Re: MySQL position saving - MadeMan - 10.12.2011

pawn Код:
`Last Pos Z` = %f, WHERE kasutaja='%s'
Remove the comma

pawn Код:
`Last Pos Z` = %f WHERE kasutaja='%s'