[Ajuda] MySql
#1

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid){
    case 
DIALOG01: {
    new 
query[1024], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME);
    
format(querysizeof(query), "SELECT * FROM `contas` WERE `usuario`= '%s' AND `senha` = %s"nameinputtext);
    
mysql_function_query(mysqlquerytrue"q_verifyPassword""d""playerid");
    }
    case 
DIALOG02:{
    if(
strlen(inputtext)<2){
    
ShowPlayerDialog(playeridDIALOG02,DIALOG_STYLE_PASSWORD"Seja bem vindo","Digite uma senha","Registrar","Cancelar");
        }else{
        
            new 
query[1024], name[MAX_PLAYER_NAME];
            
GetPlayerName(playeridnameMAX_PLAYER_NAME);
            
format(querysizeof(query), "INSERT INTO `contas` (usuario, senha) VALUES ('%s','%s')"nameinputtext);
            
mysql_function_query(mysqlqueryfalse,"""");
            
SetSpawnInfo(playerid001958.37831343.157215.37460000000);
            
SpawnPlayer(playerid);
            }
        }
    }
    return 
1;
}
forward q_verifyPassword(playerid);
public 
q_verifyPassword(playerid){
    new 
rowsfields;
    
cache_get_data(rowsfields);
    if (
rows){
        
SetSpawnInfo(playerid001958.37831343.157215.37460000000);
        
SpawnPlayer(playerid);
        return 
1;
    }
    else 
    {
        
ShowPlayerDialog(playeridDIALOG01,DIALOG_STYLE_PASSWORD"Seja bem vindo 1 novamente","Olб Novamente, digite sua senha\n\nSenha Invalida","Logar","");
        return 
1;
    }

bom o codigo e esse mas с ta verificando a senha

criar a conta cria tudo normalzin zzzzzzz>><<
coloco qualquer senha e n da em nada tambem
Reply


Messages In This Thread
MySql - by goku114 - 18.01.2014, 04:25
Re: MySql - by Gii - 18.01.2014, 04:48

Forum Jump:


Users browsing this thread: 1 Guest(s)