Mysql R8 - loading multiple rows
#1

Did a extensive search on the forums, most posts were from earlier versions and did not help. I am using BlueG's R8 Mysql Plugin (r14).

Here is how I am loading the banks:
pawn Код:
public thread_loadbank(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(rows)
    {
        cache_get_row(0, 0, bInfo[playerid][bOwner], connectionHandle, 24);
        cache_get_row(0, 1, bInfo[playerid][bNickname], connectionHandle, 50);
        bInfo[playerid][bAccountNumber] = cache_get_row_int(0, 2, connectionHandle);
        bInfo[playerid][bPin] = cache_get_row_int(0, 3, connectionHandle);
        bInfo[playerid][bType] = cache_get_row_int(0, 4, connectionHandle);
        cache_get_row(0, 5, bInfo[playerid][bCorp], connectionHandle, 50);
        bInfo[playerid][bMoney] = cache_get_row_int(0, 6, connectionHandle);
        bInfo[playerid][bMaxWithdraw] = cache_get_row_int(0, 7, connectionHandle);
       
        cache_get_row(1, 0, bInfo2[playerid][bOwner], connectionHandle, 24);
        cache_get_row(1, 1, bInfo2[playerid][bNickname], connectionHandle, 50);
        bInfo2[playerid][bAccountNumber] = cache_get_row_int(1, 2, connectionHandle);
        bInfo2[playerid][bPin] = cache_get_row_int(1, 3, connectionHandle);
        bInfo2[playerid][bType] = cache_get_row_int(1, 4, connectionHandle);
        cache_get_row(1, 5, bInfo2[playerid][bCorp], connectionHandle, 50);
        bInfo2[playerid][bMoney] = cache_get_row_int(1, 6, connectionHandle);
        bInfo2[playerid][bMaxWithdraw] = cache_get_row_int(1, 7, connectionHandle);

// MORE CODE DOWN HERE HOWEVER MY MAIN QUESTION IS ABOVE
I have a feeling I am doing it way wrong, and I am guessing I do not even need to create new variables for each different row, but it was the only thing I could think of doing.

Basically what this does is you can create multiple bank accounts and I am trying to have it so it loads them all when you connect.
Reply


Messages In This Thread
Mysql R8 - loading multiple rows - by BittleRyan - 11.04.2013, 21:37
Re: Mysql R8 - loading multiple rows - by BittleRyan - 12.04.2013, 20:24
Re: Mysql R8 - loading multiple rows - by BittleRyan - 13.04.2013, 03:20
Re: Mysql R8 - loading multiple rows - by Scenario - 13.04.2013, 03:23
Re: Mysql R8 - loading multiple rows - by BittleRyan - 20.04.2013, 02:26
Re: Mysql R8 - loading multiple rows - by Scenario - 20.04.2013, 03:12
Re: Mysql R8 - loading multiple rows - by BittleRyan - 20.04.2013, 17:09
Re: Mysql R8 - loading multiple rows - by Scenario - 20.04.2013, 17:14
Re: Mysql R8 - loading multiple rows - by BittleRyan - 20.04.2013, 18:00
Re: Mysql R8 - loading multiple rows - by Scenario - 20.04.2013, 18:16

Forum Jump:


Users browsing this thread: 1 Guest(s)