While loop problem
#6

The cache_get_field_content is from BlueG's SQL plugin (see here: https://sampforum.blast.hk/showthread.php?tid=337810)

However, I used cache_get_row rather than cache_get_field_content (which should both do the same thing, but I'm not sure why they didn't, and it worked fine. Here is the code I settled with:
pawn Код:
forward loadCars_query();
public loadCars_query()
{
    new
        rows,
        fields;
       
    cache_get_data(rows, fields);
   
    if(rows)
    {
        new
            temp[5],
            i,
            id;
           
        while(i < rows)
        {
            cache_get_row(i, 0, temp);
            id = strval(temp);
            printf("i | rows : %d | %d", id, i, rows);
            i++;
        }
    }
}
Reply


Messages In This Thread
While loop problem - by Ambokile - 28.10.2012, 12:57
Re: While loop problem - by ryansheilds - 28.10.2012, 14:28
Re: While loop problem - by Abhishek. - 28.10.2012, 14:30
Re: While loop problem - by Ambokile - 28.10.2012, 14:40
Re: While loop problem - by Ambokile - 28.10.2012, 14:47
Re: While loop problem - by Ambokile - 28.10.2012, 17:09

Forum Jump:


Users browsing this thread: 1 Guest(s)