Question about cache system.
#7

Quote:
Originally Posted by AnthonyTimmers
Посмотреть сообщение
Give me a second, if I understand what you mean.

Код:
stock GetPlayerVariableInt(playername[], tablename[])
{
	new query[128];
	mysql_format(MySQL, query, sizeof(query), "SELECT `%s` FROM `users` WHERE `name` = '%s'", tablename, playername);

	new Cache:result = mysql_query(MySQL, query);
	new var = cache_get_field_content_int(0, tablename); // 0 stands for first row
	cache_delete(result);
	
	return var;
}
Note that this will only work if you input a valid tablename, and it doesn't work if the tablename does not contain an int. Also, I'd suggest calling it columnname instead of tablename.
The tablename is users!!! I think you meant the fieldname?!
Reply


Messages In This Thread
Question about cache system. - by Omirrow - 30.11.2014, 12:35
Re: Question about cache system. - by AnthonyTimmers - 30.11.2014, 13:34
Re: Question about cache system. - by Omirrow - 30.11.2014, 14:06
Re: Question about cache system. - by AnthonyTimmers - 30.11.2014, 14:10
Re: Question about cache system. - by AnthonyTimmers - 30.11.2014, 14:15
Re: Question about cache system. - by Omirrow - 01.12.2014, 15:12
Re: Question about cache system. - by sammp - 01.12.2014, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)