ErroR mysql + pawn
#1

Hello people . I'm creating a login and registration system to my server , but I'm in trouble . The part of the record , is now finished . My problem is when I use the cache_get_field_content function to save the password value in a variable , it returns 0 .
Log in Mysql , accuses this error: ( http://imgur.com/KXGglzG ) < - Image Link is not open here in the forum .
In real is not a mistake , it's a WARNING, but Fuck , why is not working. Why does this occur? Another question , one of the parameters of this function is the " row" , I always use 0 , but do not know what it is. Help me these two questions there, please? Thank U.
OBS .: On my system , I use this function other times , and there, works perfectly .

Код:
if(dialogid == 02)
	{
		if(response)
		{
			if(!strlen(inputtext))
			{
				new string[123];
				GetPlayerName(playerid, nome, 30);
				format(string, sizeof(string), "{FFFFFF}Nick:{FFAC17} %s\n\n{FFFFFF}Digite sua senha para entrar no servidor.", nome);
				ShowPlayerDialog(playerid, 02, DIALOG_STYLE_PASSWORD, "{FFAC17}Login", string, "Confirmar", "Cancelar");
				return 1;
			}
			else
			{

				Player[playerid][Dinheiro] = cache_get_field_content_int(0, "Dinheiro");
				GivePlayerMoney(playerid, Player[playerid][Dinheiro]);
				
			}
		}
	}
In this case there, the money does not go to the player, and that WARNING the print remains .. Helpem me pls
Reply
#2

You get the error because you have not selected the player's data from the MySQL.

I.e:
pawn Код:
"SELECT * FROM `accounts` WHERE `Username` = '%s'"
That's the terminology of how you should select it, within a proper mysql_tquery function and after being formatted, of course.

After that, you'll be able to retrieve the cache which is actually what you have selected using that former syntax.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)