SA-MP Forums Archive
Count cache rows - BlueG Plugin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Count cache rows - BlueG Plugin (/showthread.php?tid=428127)



Count cache rows - BlueG Plugin - liam1412 - 04.04.2013

How do I count the number of rows in cache for the blueg plugin. Need to loop through to load all vehicles

Thanks


Re: Count cache rows - BlueG Plugin - InfiniTy. - 04.04.2013

pawn Код:
new rows,fields;
cache_get_data(rows,fields);



Re: Count cache rows - BlueG Plugin - liam1412 - 04.04.2013

That returns the rows. I want to know how many rows so I can loop.


Re: Count cache rows - BlueG Plugin - InfiniTy. - 04.04.2013

Quote:
Originally Posted by liam1412
Посмотреть сообщение
That returns the rows. I want to know how many rows so I can loop.
Well that's what it does.. it returns the NUMBER of rows in the database..

Example of mysql loop
pawn Код:
new rows,fields;
cache_get_data(rows,fields);
new i;
while(i < rows) {
    // do your stuff
    i++;
}



Re: Count cache rows - BlueG Plugin - liam1412 - 04.04.2013

Ah ok. I thought rows actually stored the rows themselves!!

Thanks