SA-MP Forums Archive
MySQL truncating player name - 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 truncating player name (/showthread.php?tid=440087)



MySQL truncating player name - zombieking - 28.05.2013

PHP код:
UPDATE users SET Name 'zombieking'Password '123qwe'Level 1Spawn 0TesterLevel 0HelperLevel 0AdminLevel 0RegularRank 0UpgradePoints 0ConnectedTime 54Registered 1Sex 2Age 23GPS 0Origin 2CK 0Muted 0Frozen 0Blind 0Respect 0Money 0Bank 0Crimes 0CrimeReason ''Wanted 0WantedLevel 0Kills 0Deaths 0Arrested 0WantedDeaths 0Phonebook 0LottoNr 0Fishes 0BiggestFish 0Job 0Paycheck 54HeadValue 0Jailed 0JailTime 0CanRobTime 0Materials 0Drugs 0Leader 0Member 0FMember 255Rank 0, `Char` = 0ContractTime 0DetSkill 0SexSkill 0BoxSkill 0LawSkill 0MechSkill 0JackSkill 0CarSkill 0NewsSkill 0DrugsSkill 0FishSkill 0pHealth 0.000000pArmour 50.000000, `Int` = 0InteriorNr 0Local 0Team 255Model 3PhoneNr 135Car 398663Car2 9999House 9999 WHERE Name 'я^¬'... 
Notice this:
PHP код:
WHERE Name 'я^¬' 
It's the same variable used in UPDATE users SET Name = 'zombieking' too (this one is working).


Re: MySQL truncating player name - zombieking - 28.05.2013

Bumping this (I know it's not allowed, but I really need a solution - I tried debugging it myself and no success)


Re : MySQL truncating player name - Stefano.R - 28.05.2013

Can you give the whole function/command and explain the problem?


Re: MySQL truncating player name - zombieking - 28.05.2013

The query I posted is the final result of using format (used the same variable for both of the player name occurrences). And, for some reason, this variable is sometimes truncated


Re: MySQL truncating player name - TheStreetsRP - 28.05.2013

Just curious why you're constantly setting the username? I would remove username='%s', entirely since you're likely not actually updating it, especially since you're looking FOR that username.. Just so you can set it to the exact thing you're searching for.

AhhhHhHhH my brain


Re: MySQL truncating player name - zombieking - 28.05.2013

If the player changed his name - that's a situation.


Re: MySQL truncating player name - Pupak - 28.05.2013

Post format function that generated that string.


Re: MySQL truncating player name - zT KiNgKoNg - 28.05.2013

Try using something like this

pawn Код:
format(Query, sizeof(Query), "UPDATE `users` SET (Name, Password) VALUES ('%s','%s')", GetPname(playerid), "PASS");



Re: MySQL truncating player name - zT KiNgKoNg - 28.05.2013

Try using something like this

pawn Код:
format(Query, sizeof(Query), "UPDATE `users` SET (Name, Password) VALUES ('%s','%s')", GetPname(playerid), "PASS");

You might as well use something like, Because you're basically just going to remove the name itself and have nothing for the query to search...
pawn Код:
"UPDATE `users` SET (Name, Password) VALUES ('%s','%s')  WHERE `Name` = '%NAME%"
Again this is upto you can i can't anymore without see the entire part of what you need help with, Thanks.