Best way to save Server Settings [MySQL]
#3

Quote:

Setting column as string
Value column as integer or w/e

I understand it.But how to load it in enum?
I know just on this way with strcmp,but i think it's not good

Код:
mysql_tquery(g_SQL,SELECT * FROM `settings`","LoadSettings");
Код:
forward LoadSettings();
public LoadSettings()
{
	new rows = cache_num_rows();
	new setting[20],value;
	if(rows)
	{
		for(new i; i<rows; i++)
		{
			cache_get_value_name(i,"SettingName",setting);
			cache_get_value_int(i,"Value",value);
			if(strcmp(setting, "isAds") == 0)
			{
				ServerInfo[isAds] = value;
			}
			else if(strcmp(setting, "isReport") == 0)
			{
				ServerInfo[isReport] = value;
			}
			..
			...
		}
	}
	return 1;
}
Reply


Messages In This Thread
Best way to save Server Settings [MySQL] - by GospodinX - 18.06.2018, 09:15
Re: Best way to save Server Settings [MySQL] - by FailerZ - 18.06.2018, 09:32
Re: Best way to save Server Settings [MySQL] - by GospodinX - 18.06.2018, 09:49
Re: Best way to save Server Settings [MySQL] - by Calisthenics - 18.06.2018, 09:56

Forum Jump:


Users browsing this thread: 1 Guest(s)