Problem ussing sscanf mysql login system not splitting username and password up
#1

Hello when i log in and then print my name it shows up as this
"Username|487ewifhdsjbjdsbfjsdgfhdsgfdsufiyhsdjhfb wbshjbfduih"
its printing the username and password which is using whirlpool together how can i solve this?

Код:
	    new result[256];
	    mysql_fetch_row(result);
		sscanf(result, "p<|>{s[25]s[130]}i",PlayerInfo[playerid][pAdminLevel]); // This line is causing the problem

		PlayerInfo[playerid][pLogged] = 1;
Heres the full login command
http://pastebin.com/U0uVM2LL
Reply
#2

anybody?
Reply
#3

Can you show sample output from the select * from users SQL statement? It looks syntactically correct on the sscanf and you aren't touching the other parts of your enum so they should be unaffected.
Reply
#4

Your problem is the sscanf line. Your not defining the enums from the gathering....

example:
Код:
sscanf(result, "p<|>{s[25]s[130]}i",PlayerInfo[playerid][user], PlayerInfo[playerid][pass], PlayerInfo[playerid][pAdminLevel]);
I'm assuming you've written the correct p<|> order from the actual database order to gather and store.
Darren
Reply
#5

Quote:
Originally Posted by dazman14
Посмотреть сообщение
Your problem is the sscanf line. Your not defining the enums from the gathering....

example:
Код:
sscanf(result, "p<|>{s[25]s[130]}i",PlayerInfo[playerid][user], PlayerInfo[playerid][pass], PlayerInfo[playerid][pAdminLevel]);
I'm assuming you've written the correct p<|> order from the actual database order to gather and store.
Darren
You don't need to specify variables for quiet sections
Btw @OT, why would you use 'p' specifier for a sscanf line that has only an integer and other stuffs are in quiet sections.

You do have another sscanf line right? In which the strings are not in quiet sections.
Reply
#6

Quote:
Originally Posted by nemesis-
Посмотреть сообщение
Can you show sample output from the select * from users SQL statement? It looks syntactically correct on the sscanf and you aren't touching the other parts of your enum so they should be unaffected.
i dont fully understand, example of what?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)