Calling Functions
#4

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Here you go, Mr. Lead Scripter:

PHP код:
    new queryS[128]; 
    
mysql_format(registerquerySsizeof(queryS), "SELECT Password FROM accounts WHERE Name = '%e' LIMIT 1;"GetName(playerid));  
    new 
Cache:resultsX mysql_query(registerqueryS); 
    new 
rows;
    
cache_get_row_count(rows); 
    
    if(
rows)  
    {  
        
cache_get_value_name(0"Password"PlayerInfo[playerid][Password]);  
        
cache_delete(resultsX); 
        
ShowPlayerDialog(playeridLogin+200DIALOG_STYLE_INPUT"Login""Welcome !\nthis account already registred. Please fill in your password:""Login""Quit");  
    }  
    else 
    { 
        
isGuest[playerid] = 1
    } 
    return 
1

And yes, your code will still fail i guess, anyways, use mysql_errno() to check if u get any errors and check your mysql log.


Btw you might not want to use Limit 1 in that case, since it should be impossible to get more than 1, if u get more, you have a defect in your register system
Setting limit will ofcourse increase performance since when system finds one or specified number of match it will "break" searching through rows and prepare cache/result.
Reply


Messages In This Thread
Calling Functions - by Yaa - 28.12.2016, 20:23
Re: Calling Functions - by BiosMarcel - 28.12.2016, 21:06
Re: Calling Functions - by SickAttack - 28.12.2016, 23:33
Re: Calling Functions - by Gammix - 29.12.2016, 09:38
Re: Calling Functions - by BiosMarcel - 29.12.2016, 09:45
Re: Calling Functions - by Gammix - 29.12.2016, 09:58
Re: Calling Functions - by Yaa - 29.12.2016, 10:28
Re: Calling Functions - by iLearner - 29.12.2016, 11:56

Forum Jump:


Users browsing this thread: 2 Guest(s)