how to load strings from mysql?
#3

Код:
LoadOstats(playerid)
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid, name, sizeof(name));
	new query[128];
	format(query, sizeof(query), "SELECT * FROM ostats WHERE name='%s'", name);
	mysql_query(query);
	mysql_store_result();
	
	new row[128];
	new field[13][32];

	mysql_fetch_row_format(row, "|");
	explode(row, field, "|");

	org[playerid] =strval(field[1]);
	leader[playerid]=strval(field[3]);
	req[playerid]=strval(field[2]);
	
	mysql_free_result();
	
	new string[128];
	format(string, sizeof(string), "SELECT * FROM orgs WHERE ID=%d", org[playerid]);
	mysql_query(string);
	mysql_store_result();
	mysql_fetch_row_format(row, "|");
	explode(row, field, "|");
	oname[playerid]=strval(field[1]);
	ocolour[playerid]=strval(field[2]);
	otype[playerid]=strval(field[3]);
	oskin[playerid]=strval(field[4]);
	oskin1[playerid]=strval(field[5]);
	oskin2[playerid]=strval(field[6]);
	mysql_free_result();
	return 1;
}
need it for oname and ocolour
Reply


Messages In This Thread
how to load strings from mysql? - by THE_KNOWN - 03.02.2011, 15:55
Re: how to load strings from mysql? - by DVDK - 03.02.2011, 16:00
Re: how to load strings from mysql? - by THE_KNOWN - 03.02.2011, 16:08
Re: how to load strings from mysql? - by JaTochNietDan - 03.02.2011, 16:13
Re: how to load strings from mysql? - by THE_KNOWN - 03.02.2011, 16:39
Re: how to load strings from mysql? - by DVDK - 03.02.2011, 17:19
Re: how to load strings from mysql? - by JaTochNietDan - 03.02.2011, 17:30
Re: how to load strings from mysql? - by THE_KNOWN - 04.02.2011, 01:03
Re: how to load strings from mysql? - by PeteShag - 04.02.2011, 01:25
Re: how to load strings from mysql? - by THE_KNOWN - 04.02.2011, 10:32

Forum Jump:


Users browsing this thread: 3 Guest(s)