SAMP MySQL Help
#7

There is not equivalent.

SQLite stores only on row and can move to the next but not to previous.
MySQL on the other hand can access any row anytime.

You shouldn't create variables inside loops, move them outside and you call cache_get_row_count multiple times. The optional parameter is also connection handle not the cache id as well as retrieving data require a row id, not the cache id.

pawn Код:
new dialog[128 * 15], name[24], lastname[24], ID, VIP;
dialog = "Name\tLastname\tID\tVIP\t";

for(new i, j = cache_get_row_count(); i < j; i++ )
{
    cache_get_field_content(i, "NAME", name, 24);
    cache_get_field_content(i, "LASTNAME", lastname, 24);
    connected = cache_get_row_int(i, "ID");
    rank = cache_get_row_int(i, "VIP");

    format(dialog, sizeof dialog, "%s%s\t%s\t%d\t%d", dialog, name, lastname, ID, VIP);
}

cache_delete(Result);
ShowPlayerDialog(playerid, VIP_LIST, DIALOG_STYLE_TABLIST_HEADERS, dialog, "OK", "");
It is also always suggested to use threaded queries.
Reply


Messages In This Thread
SAMP MySQL Help - by Miguelch1312 - 20.06.2018, 03:43
Re: SAMP MySQL Help - by div - 20.06.2018, 03:50
Re: SAMP MySQL Help - by Miguelch1312 - 20.06.2018, 04:32
Re: SAMP MySQL Help - by div - 20.06.2018, 04:43
Re: SAMP MySQL Help - by Miguelch1312 - 20.06.2018, 04:59
Re: SAMP MySQL Help - by div - 20.06.2018, 05:38
Re: SAMP MySQL Help - by Calisthenics - 20.06.2018, 07:17

Forum Jump:


Users browsing this thread: 1 Guest(s)