Mysql problem
#1

Код:
if(playertextid == GreenButton) {
		if(strlen(InputtText[playerid]) < 4) return 1;
		if(strlen(PlayerInfo[playerid][pPin]) == 1) {
			format(PlayerInfo[playerid][pPin], 5, InputtText[playerid]);
			format(szQuery, sizeof(szQuery), "UPDATE `users` SET `Pin`='%s' WHERE `Name`='%s'", PlayerInfo[playerid][pPin], PlayerInfo[playerid][pNormalName]);
			mysql_query(SQL, szQuery);
			SendClientMessage(playerid, -1, "{FFFF45}Ai setat codul de securitate al contului.");
		}
Why is this not working? The Pin is not saving.

The table is not made by me, I searched 'Pin' in the users mysql table and there is no field for that, how can I add one for all new users that register.. didn't really work with mysql until today.

I also found this and I am not sure what is it
Код:
PlayerInfo[playerid][pPin] = cache_get_field_content(0, "Pin", string);
Reply
#2

You're checking if the length is exactly 1 while it should presumably be 4 or greater. In that case the second strlen if-statement is completely redundant because if the length is not less than 4 then it is obviously 4 or greater.
Reply
#3

So this should be like this?:

if(strlen(PlayerInfo[playerid][pPin]) >= 1)


the pin can only be of 4 so it cant be higher or lower.
Reply
#4

Uh I set it as == 4 and the whole system bugged, if I use the command now it sets a new pin instead of asking me to type my pin to log in.

I really don't understand whats the problem..
Reply
#5

bump, anyone please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)