MySQL loading problem
#7

Quote:
Originally Posted by SandKing94
Посмотреть сообщение
Then how to load player account ? ?
Код:
public LoadAccount(playerid)
{
    cache_get_field_content(0,"Password",pInfo[playerid][Password]);
    pInfo[playerid][Level] = cache_get_field_content_int(0,"Level");
    pInfo[playerid][Hours] = cache_get_field_content_int(0,"Hours");
    pInfo[playerid][Minutes] = cache_get_field_content_int(0,"Minutes");

    return 1;
}
This code is valid.

The first parameter of cache_get_field_content is the row index(which start at 0). So it's okay to use 0 if you only load 1 row(like you do here).

But if you select multiple rows, you will need to loop through all of them because index 0 is merely the first row, that second one will be at index 1 and so on.
Reply


Messages In This Thread
MySQL loading problem - by SandKing94 - 01.06.2015, 06:07
Re: MySQL loading problem - by rickisme - 01.06.2015, 07:13
Re: MySQL loading problem - by Psykotikum - 01.06.2015, 07:39
Re: MySQL loading problem - by Konstantinos - 01.06.2015, 10:47
Re: MySQL loading problem - by SandKing94 - 01.06.2015, 16:05
Re: MySQL loading problem - by Stev - 01.06.2015, 16:09
Re: MySQL loading problem - by dusk - 01.06.2015, 16:36
Re: MySQL loading problem - by Konstantinos - 01.06.2015, 16:41
Re: MySQL loading problem - by SandKing94 - 01.06.2015, 16:59
Re: MySQL loading problem - by dusk - 01.06.2015, 17:02

Forum Jump:


Users browsing this thread: 2 Guest(s)