MySQL problem
#1

Hello!
I have a little problem.
Find only the first id in the database, the restu is = 0.
I hope you understand me.

PHP код:
    format(szQuerysizeof(szQuery), "SELECT * FROM `accounts` WHERE `Clan` = '%d'"clanid);
    new 
Cacheresult mysql_query(mysqlszQuery);
    new 
idwtf[256];
    for(new 
icache_get_row_count (); != j; ++i)
    {
        
cache_get_field_content(0"ID"idwtf);
        
printf("%d"strval(idwtf));
    }
    
cache_delete(result); 
Reply
#2

You are running a loop and execute the same command each time.
You don't need to call the content of row "0" but of row "i"
Код:
    format(szQuery, sizeof(szQuery), "SELECT * FROM `accounts` WHERE `Clan` = '%d'", clanid); 
    new Cache: result = mysql_query(mysql, szQuery); 
    new idwtf[256]; 
    for(new i, j = cache_get_row_count (); i < j; i++) 
    { 
        cache_get_field_content(i, "ID", idwtf); 
        printf("%d", strval(idwtf)); 
    } 
    cache_delete(result);
Reply
#3

Fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)