MySQL truncating player name
#1

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

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

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

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

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

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

Post format function that generated that string.
Reply
#8

Try using something like this

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)