I should have provided the code to you, my bad.
PHP Code:
get_cvar_string("amx_sql_host", host, charsmax(host));
get_cvar_string("amx_sql_user", user, charsmax(user));
get_cvar_string("amx_sql_pass", pass, charsmax(pass));
get_cvar_string("amx_sql_db", db, charsmax(db));
server_print("host: %s^nuser: %s^npass: %s^ndb: %s", host, user, pass, db);
It simply prints the content of these variables before I try to create a connection tuple.
From your comment I realized that it is the admin plugin that handles all the routine. And the reason why I get empty string is that I do not use this plugin) I thought these variables are read by amxmodx module itself or any other module, not plugins. I have checked admin.sma code, it first calls register_cvar to register custom variables, then it executes server command
PHP Code:
exec "path_to_config.cfg"
to get real values. Thank you, it now works.