SAMP MySQL Help
#5

No i mean getting the diferrent rows from the MySQL Table and showing it, look, like

--SELECT `NAME`,`LASTNAME`,`ID`, `VIP` FROM `PLAYERS`WHERE `VIP` >= 1 ORDER BY `ID`--

This will do a MySQL query with all the rows with the players that have his vip level more than 1, so then i make a loop to reach all the rows.

Код:
new dialog[128 * 15];
format(dialog, sizeof dialog, "Name\tLastname\tID\tVIP\t");

for(new i; i < cache_get_row_count(Result); i++ )
{
	new name[24], lastname[24], ID, VIP;

	cache_get_field_content(Result, "NAME", name, 24);
	cache_get_field_content(Result, "LASTNAME", lastname, 24);
	connected = cache_get_row_int(Result, "ID");
	rank = cache_get_row_int(Result, "VIP");

	new dline[128];
	format(dline, sizeof dline, "%s\t%s\t%d\t%d", name, lastname, ID, VIP);

	strcat(dialog, dline);
	listitem ++;

	db_next_row(Result);// THIS IS FROM SQLite I NEED THIS IN MYSQL R39-5
}
cache_delete(Result);
ShowPlayerDialog(playerid, VIP_LIST, DIALOG_STYLE_TABLIST_HEADERS, dialog, "OK", "");
db_next_row(Result);This line is from SQLite, i need to update it to MySQL and i dont know what's the statement or the way, its to catch the information from the next row
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: 2 Guest(s)