MySQL position saving
#1

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.
Reply
#2

Check your MySQL log.
Reply
#3

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

Yes.
Reply
#5

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)
Reply
#6

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);
Reply
#7

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
Reply
#8

Код:
[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.
Reply
#9

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)