Iterators problem with mysql
#1

PHP код:
stock save(playerid)
{
    new 
Iteratortest_iter<20>;
    new 
tmp_uidnick[30];
    
mysql_query(MyDB"SELECT uid, Nick FROM players WHERE PD = 1");
    new 
cache_num_rows();
    
    for(new 
nr 0nr jnr++)
    {
        
cache_get_value_int(nr"uid"tmp_uid);
        
cache_get_value(nr"Nick"nick30);
        
                
printf("From sql: %d",tmp_uid);
        
Iter_Add(test_itertmp_uid);
    }
    
    foreach(new 
load test_iter)
    {
        
printf("From iter: %d"load);
    }

Result:
From sql: 1,2,3,4
From iter: 1

Why iter save only first number?
Reply


Messages In This Thread
Iterators problem with mysql - by Oficer - 01.02.2019, 09:06
Re: Iterators problem with mysql - by SymonClash - 01.02.2019, 09:22
Re: Iterators problem with mysql - by Oficer - 01.02.2019, 11:32
Re: Iterators problem with mysql - by Oficer - 01.02.2019, 16:36
Re: Iterators problem with mysql - by m4karow - 01.02.2019, 17:04
Re: Iterators problem with mysql - by Oficer - 01.02.2019, 19:02
Re: Iterators problem with mysql - by m4karow - 01.02.2019, 19:10
Re: Iterators problem with mysql - by Oficer - 02.02.2019, 16:31
Re: Iterators problem with mysql - by Calisthenics - 02.02.2019, 16:43
Re: Iterators problem with mysql - by Oficer - 02.02.2019, 16:53

Forum Jump:


Users browsing this thread: 2 Guest(s)