o Juha Heinanen on 12/13/2011 05:48 PM:
i tried to pass mysql url from config variable to mysql.connect()
function:
mysql.connect($config.db_url);
and
mysql.connect(eval($config.db_url));
in both cases, connect function didn't receive value of the variable,
but the text that is within ().
how do i pass variable values to dsm functions?
yes,i know that connect can automatically take mysql url from db.url
config variable, but this question is generic. i need to construct
db_url from more than one variable.
mysql.connect was one of the few old functions which accepted only a
string literal. now it does, like most other functions, accept a
literal, variable, select or param.
e.g.
sets($db_url="mysql://$(my_user):$(my_pwd)@local/db");
mysql.connect($db_url);
or,
mysql.connect($config.backup_db_url);
sets (for 'set string') is a pretty useful function to build together
string values.
Stefan
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems