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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL, problem (/showthread.php?tid=142776)



MySQL, problem - bfkj - 19.04.2010

Hey guys,

i have a problem with MySQL. I want to save the Money in a field, but i got a error message:

Here is it:

Код:
[21:34:44] [join] Lord has joined the server (0:127.0.0.1)[21:35:00] MySQL Error (0): Could not execute query. 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.[21:35:00] UPDATE `userdata` set `money` =[21:35:00][21:35:00] [part] Lord has left the server (0:1)
Here are the lines where i want to save the money:

Код:
      new query[32];
      new Cash = GetPlayerMoney(playerid);
			format(query,sizeof(query),"UPDATE `userdata` SET `money` = '%s' WHERE `Nickname` = '%s'",Cash,playername);
			mysql_query(query);
I use this Plugin for MySQL: http://forum.sa-mp.com/index.php?topic=148182.0


Re: MySQL, problem - Carlton - 19.04.2010

Watch your formats, be careful. Use this query. Your problem was you tried to update a int with a string format.

pawn Код:
UPDATE `userdata` SET `money` = %d WHERE `Nickname` = '%s'



Re: MySQL, problem - bfkj - 19.04.2010

Ok i was changed, but i was become the same error message,. =/


Edit: Thanks champ it run =).