SA-MP Forums Archive
[AJUDA]Mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA]Mysql (/showthread.php?tid=279326)



[AJUDA]Mysql - FireCat - 26.08.2011

Quero selecionar da minha table o AccID
Estб em auto_increment mas nгo sei como lб chegar
Codigo:
pawn Код:
if(dialogid == Regdialog2)//Inputting password dialog
    {
        new string[200],tempquery[100],PlayerAccID;
        if(strlen(inputtext) == 0)
        {
            ShowPlayerDialog(playerid,Regdialog2,DIALOG_STYLE_INPUT,""cblue"Register - "cyellow"Enter your password",""cblue"You are about to register a "cyellow"new account"cblue"! \nPlease choose the "corange"password"cblue" for it! \n","Register!","");
            SendClientMessage(playerid,red,"Please input a password!");
        }
        else
        {
            format(Query,sizeof(Query),"INSERT INTO `Users` (Username,Password) VALUES ('%s','%s')",GetPName(playerid),inputtext);
            mysql_query(Query);
            format(tempquery,sizeof(tempquery),"SELECT * FROM `Users` WHERE `Username` = '%s' AND `AccID` = '%i'",GetPName(playerid),PlayerAccID);
            mysql_query(tempquery);
            mysql_store_result();
            SendClientMessage(playerid,green2,"You have been successfully registered!");
            format(string,sizeof(string),""cgreen"You have been successfully registered! \n"cwhite"» Your username: "cblue"%s \n"cwhite"» Your password: "cblue"%s \n"cwhite"» Your account ID: "cblue"%i",GetPName(playerid),inputtext,PlayerAccID);
            ShowPlayerDialog(playerid,Reginfo,0,"Registered!",string,"Ok","");
            mysql_free_result();
        }
    }



Re: [AJUDA]Mysql - Bryaan_Smith - 26.08.2011

format(tempquery,sizeof(tempquery),"SELECT * FROM `Users` WHERE `Username` = '%s' AND `AccID` = '%i'",GetPName(playerid),PlayerAccID);

Й sу editar, "SELECT" = seleciona, USERS = Tabela dentro da DB, e WHERE = COLUNA de dentro da tabela.. SQL й Facil

Ajudei? Reputaзгo *-*


Re: [AJUDA]Mysql - [S]trong - 26.08.2011

Se estб querendo selecionar a AccID para salvar em um arquivo й isto o Query.

pawn Код:
format(tempquery,sizeof(tempquery),"SELECT `AccID` FROM `Users` WHERE `Username` = '%s'",GetPName(playerid));



Re: [AJUDA]Mysql - FireCat - 26.08.2011

Jб tinha arranjado :b Mas obrigado na mesma