20.06.2018, 07:17
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.
It is also always suggested to use threaded queries.
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", "");