GetName
#1

Hello ..
I get a bug ..This code don't get the name .
.
PHP код:
NameMysql(playerid)
{
    
    new 
nameR[MAX_PLAYER_NAME+1];
    static 
query[60], DBResult:db_result;
    
    
format(querysizeof query"SELECT `name` FROM `users` WHERE `id` = '%d'"playerid);
    
    
db_result db_query(mysqlquery);
    if(
db_num_rows(db_result))
    {
    
cache_get_field_content(db_result"name"nameRmysqlsizeof nameR);
    }
    
db_free_result(db_result);
    
    return 
nameR;

Are is a error ?

Thanks for you'r help !
Reply
#2

Resolved !

PHP код:
NameMysql(playerid)
{
    new 
nameR[MAX_PLAYER_NAME+1];
    static 
query[60], Cache:result;
    
format(querysizeof query"SELECT `name` FROM `users` WHERE `id` = '%d'"playerid);
    
result mysql_query(mysqlquery);
    
cache_get_field_content(0"name"nameRmysqlsizeof nameR);
    
cache_delete(result);
    return 
nameR;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)