[MySQL] How to return name from SQLID?
#8

Quote:
Originally Posted by Dayrion
View Post
Check that: https://sampwiki.blast.hk/wiki/MySQL/R40

PHP Code:
Plant_GetOwner(sqlid

    new 
        
query[128],
        
Cache:query_cache
    
format(querysizeof(query), "SELECT `Character` FROM `characters` WHERE `ID` = '%d'"ReturnName(sqlid)); 
    
query_cache mysql_query(g_iHandlequery"OnQueryFinished""dd"sqlidTHREAD_FIND_USERNAME);
    if(
cache_num_rows())
        
cache_get_value_index(00query);
    else
        
strcpy(query"N/A"); 
    
cache_delete(query_cache);
    return 
query

Yes man, i tried to look but the functions are not the same? in mine mysql_format is directly format(query..
format(query, sizeof(query),

and mysql_query too doesn't exist in my gamemode, wtf but mysql_tquery yes,
query_cache doesn't exist in my gm.. i dont understand nothing, but i solved it in other ways..


EDIT: It seems no error on compile, i go rewrite my code to try your function if works, i've get solved it with other ways, create varchar ownerPlant and get player name on creating the plant.. fast solution XD becouse i dont found how to return player sqlid name

EDIT2:

Code:
C:\Reality Roleplay\gamemodes\sqlidnameroleplay.pwn(8465) : error 035: argument type mismatch (argument 3)
C:\Reality Roleplay\gamemodes\sqlidnameroleplay.pwn(8467) : error 017: undefined symbol "cache_get_value_index"
C:\Reality Roleplay\gamemodes\sqlidnameroleplay.pwn(8469) : error 017: undefined symbol "strcpy"
EDIT3: https://sampwiki.blast.hk/wiki/MySQL/R33

it seems that i use this becouse i use cache_get_field_content, right?
Reply


Messages In This Thread
[MySQL] How to return name from SQLID? - by R3SpaWn0 - 04.08.2018, 18:07
Re: [MySQL] How to return name from SQLID? - by Florin48 - 04.08.2018, 18:18
Re: [MySQL] How to return name from SQLID? - by R3SpaWn0 - 04.08.2018, 18:20
Re: [MySQL] How to return name from SQLID? - by Dayrion - 04.08.2018, 18:53
Re: [MySQL] How to return name from SQLID? - by R3SpaWn0 - 04.08.2018, 18:57
Re: [MySQL] How to return name from SQLID? - by R3SpaWn0 - 04.08.2018, 20:46
Re: [MySQL] How to return name from SQLID? - by Dayrion - 04.08.2018, 20:53
Re: [MySQL] How to return name from SQLID? - by R3SpaWn0 - 04.08.2018, 21:01

Forum Jump:


Users browsing this thread: 1 Guest(s)