mySQL problem
#1

EDIT: FIXED

I can't get mySQL to save player position. Here is my code:
pawn Код:
SavePlayerData(playerid)
{
    new Float:x, Float:y, Float:z, Float:a;
    GetPlayerPos(playerid, x, y, z);
    GetPlayerFacingAngle(playerid, a);
   
    new query[600];
    format(query, 600, "UPDATE accounts SET LastX = '%f', LastY = '%f', LastZ = '%f', LastA = '%f' WHERE ID = '%d'", x, y, z, a, PlayerInfo[playerid][ID]);
    mysql_query(query);
    return 1;
}
Note: Please don't make a comment on my signature. I've already used ****** -.-
Reply
#2

pawn Код:
UPDATE accounts SET ( LastX, LastY, LastZ, LastA ) WHERE ID = '%d' VALUES( '%f', '%f', '%f', '%f' )
Try that query.
Reply
#3

I don't know what you mean exactly, but if its not saving in the .sql database, try using this

PHP код:
ConnectToDatabase(); 
Reply
#4

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
pawn Код:
UPDATE accounts SET ( LastX, LastY, LastZ, LastA ) WHERE ID = '%d' VALUES( '%f', '%f', '%f', '%f' )
Try that query.
I fixed it right before you posted. I changed
pawn Код:
WHERE ID = '%d'
to
pawn Код:
WHERE Name = '%s'
Thank you for the response, anyway.
Reply
#5

Using the mysql_debug function could also help a lot.
Reply
#6

pawn Код:
mysql_debug(1);
On OnGameModeInit then go to the MySQL log in the server directory and paste it here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)