BlueG MySQL - cache_get_row_count and cache_get_value_name
#9

Ahh! I didn't really read into your code but now I see the error
PHP код:
mysql_format(databasequerysizeof query"SELECT * FROM `users` WHERE `username` = %e LIMIT 1"pInfo[playerid][pUsername]);
mysql_tquery(databasequery); // You are not using a callback 
To use this query properly you need to do this

PHP код:
mysql_format(databasequerysizeof query"SELECT * FROM `users` WHERE `username` = %e LIMIT 1"pInfo[playerid][pUsername]);
mysql_tquery(databasequery"OnPlayerCheckAccount""d"playerid); 
Now the callback should look like this
PHP код:
forward OnPlayerCheckAccount(playerid);
public 
OnPlayerCheckAccount(playerid){
    if(
cache_num_rows()){
        
cache_get_value(0"password"PlayerData[playerid][password], MAX_PASS);
        
cache_get_value(0"salt"PlayerData[playerid][salt], MAX_SALT);
        
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_PASSWORD); // you know the rest
    
}else{
        
ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_PASSWORD"Register""Enter passowrd""Submit""");
    }
    return 
1;

I can also teach you mysql_tquery_inline if you wish.
It will not use external callbacks but inline callbacks
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)