Server crashes when logging in (MySQL)
#4

PHP код:
if(dialogid == 15500)
    {
        if(!
response)
        {
                
SendClientMessage(playerid0xFF0000"You must login before you spawn!");
                
ShowPlayerDialog(playerid15500DIALOG_STYLE_INPUT"Login","Your user is {FF0000}registered{FFFFFF}! Please {0000FF}login{FFFFFF} with your password below!\n{FF0000} You must login before you spawn!","Login","Cancel");
        }
        if(
response)
        {
            new 
query[200], pname[24], escapepass[100];
            
GetPlayerName(playeridpname24);
            
mysql_real_escape_string(inputtextescapepass);
            
format(querysizeof(query), "SELECT `user` FROM playerdata WHERE user = '%s' AND password = '%s'"pnameescapepass);
            
mysql_query(query);
            
mysql_store_result();
            new 
numrows mysql_num_rows();
            if(
numrows == 1MySQL_Login(playerid);
            if(!
numrows)
            {
                
ShowPlayerDialog(playerid15500DIALOG_STYLE_INPUT"Login","Your user is {FF0000}registered{FFFFFF}! Please {0000FF}login{FFFFFF} with your password below!\n{FF0000} The password you typed was incorrect!","Login","Cancel"); //Shows our login dialog :).
                
SendClientMessage(playerid0xFF0000"Incorrect password!");
            }
            
mysql_free_result();//THIS!! Should be before MySQL_Login(playerid);
        
}
    } 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)