SA-MP Forums Archive
Saving stats with mysql - 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: Saving stats with mysql (/showthread.php?tid=140867)



Saving stats with mysql - Ozz - 10.04.2010

Hi, so I got a prob with a stats saving function with mysql, here's the code: http://pastebin.com/PRcQtD27

Everything in the first query works properly but in the second query shit gets mixed up. If you wonder why I have two of them, it's because I got an error for having a too long query bla, lol.

This is how it saves when I register(defaults):
DriversLicense = 0
Job = -1
HouseID = 15000
Bank = 0

It supposed to save like this:
DriversLicense: 1
Job: 0
HouseID: -1
Bank: 15000

mysql logs:
mysql_query("UPDATE Accounts SET Admin = 0,Money = 0,Rank = 'Civilian',Level = 1,Banned = 0,BanReason = '',Carslots = 1,Faction = 0,Skin = 83,Health = '80.000000',Armour = '0.000000',GroupID = 0,FactionPermission = 0,FirstLogin = 0,Origin = 'asd',Sex = 1,Age = 15,Jailed = 0,JailTime = 0,Renting = 0,Cars = 0,Phone = 28638,Hour = 0,Minute = 0,Second = 2,cX = 0.000000,cY = 0.000000,cZ = 0.000000,Interior = 0,VW = 0, WalkieTalkie = 0,Frequency = 0,KnowledgePoints = 0 WHERE Name='Craig_Collint'"); Return: 1

mysql_query("UPDATE Accounts SET DriversLicense = 0,Job = -1,HouseID = 15000 ,Bank = 0 WHERE Name='Craig_Collint'"); Return: 1

Sorry if I explained shitty, and lemme know if there's anything you need to know.



Re: Saving stats with mysql - K3lroy - 10.04.2010

Did you try making two stocks instead of one? I mean so you dont have both queries in the same function.


Re: Saving stats with mysql - Ozz - 11.04.2010

Quote:
Originally Posted by K3lroy
Did you try making two stocks instead of one? I mean so you dont have both queries in the same function.
That wouldnt even make any difference, would it? :S

Anyone else got any idea of how to fix dis?