SA-MP Forums Archive
How to load data ? - 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: How to load data ? (/showthread.php?tid=448435)



How to load data ? - NeroX98 - 04.07.2013

Hi guys

I have problem/question about mysql loading data (with the new BlueG R7 plugin)... I have already created creating and saving player data, but how can i load them, with what function ?
mysql_get doesn't work with the new plugin, cache_get_data gets the number of rows and fields, and Select * is selecting all columns not rows. Any Idea ?

Maybe there is some statemant to select all rows like Select * (this is for columns) ?


Re: How to load data ? - Konstantinos - 04.07.2013

https://sampforum.blast.hk/showthread.php?tid=337810


Re: How to load data ? - NeroX98 - 04.07.2013

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
I know that link, with his tutorial i've already made saving and creating data, but how to get the ROW whitch primary key is his name...

If i use
Код:
cache_get_row(0 (HOW TO GET THIS ?), 0, string1);
Then how to get this row... maybe the player row is 36 for example, but i don't know his row, then how to get it ?


Re: How to load data ? - Konstantinos - 04.07.2013

If the rows are not 0,1 then simply use a loop.

pawn Код:
new
    rows,
    fields
;
cache_get_data( rows, fields );
for( new i = 0; i < rows; i++ )
{
    cache_get_row( i, idx, dest[ ] ); // replace idx with the index you want and the destination too.
    // ...
}