Iterators problem with mysql
#8

This example is ok, but when I want add values from database, iterator save only first record. Just like here:

PHP код:
stock test2(playerid)
{
    new 
Iterator Iter_Test<20>;
    
mysql_query(MyDB"SELECT Money from players"); 
    new 
moneyinfo[128];
    for(new 
0cache_num_rows(); != j; ++i
    {
        
cache_get_value_int(i,"Money"money); 
        
Iter_Add(Iter_Testmoney);
        
        
format(infosizeof(info), "Money: %d"money);
        
SCM(playerid0xFFFFFFFFmoney);
    }
    foreach(new 
id Iter_Test)
    {
        
printf("%d"id);
    }
    return 
1;

Same, iterator don't save all records, but only one:

SCM >> 150, 2000, 350
print Iter_test in foreach, return only 150

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)