MySQL problem
#1

We have created a system and I have a little problem when extracting the name of the player database.
I do not know how well I understand but so idea:

PHP код:
mysql_format(SQLszQuerysizeof(szQuery), "SELECT * FROM `aplicatii`");
result mysql_query(SQLszQuery);
for(new 
icache_get_row_count (); != j; ++i) {
    
cache_get_field_content(i"Userid",szResult); userid strval(szResult);
    
cache_get_field_content(i"Date"szResult); format(date256szResult);
    
printf("%d | %s"useriddate);
    
format(szDialogsizeof(szDialog), "%s\t%s\n"GetNameFromDB(userid), date);
    
strcat(szDialog2szDialog);
    
Selected[playerid][x] = userid;
    
x++;
}
cache_delete(result);
    
stock GetNameFromDB(userid) {
    new 
szQuery[256], Cacheresult;
    
mysql_format(SQLszQuerysizeof(szQuery), "SELECT * FROM `users` WHERE `id`='%d'"userid);
    
result mysql_query(SQLszQuery);
    new 
szResult[256], szName[256];
    
format(szName256"Null");
    for(new 
icache_get_row_count (); ji++)
    {
         
cache_get_field_content(i"username"szResult); format(szName256szResult);
    }
    
cache_delete(result);
    
printf("%s"szName);
    return 
szName;

Debug:
PHP код:
With GetNameFromDB(userid):
[
12:35:061
[12:35:06Null
[12:35:061
[12:35:06Null
[12:35:061
[12:35:06Null
[12:35:061
Without
:
[
12:12:151
[12:12:152
[12:12:153
[12:12:15
Database:
I hope you understand.
Reply


Messages In This Thread
MySQL problem - by Edw - 28.06.2016, 10:33
Re: MySQL problem - by Edw - 28.06.2016, 13:31
Re: MySQL problem - by SyS - 28.06.2016, 13:55
Re: MySQL problem - by Edw - 28.06.2016, 15:06
Re: MySQL problem - by Wantedboy21 - 28.06.2016, 15:42
Re: MySQL problem - by Konstantinos - 28.06.2016, 15:57

Forum Jump:


Users browsing this thread: 1 Guest(s)