sc_connection_edit("Connetion_Name", $arr_conn)

The edited connection will only be available in the next application.

This macro edits an existing connection at runtime. ("Connection_Name", $arr_conn)

1st Parameter: Name of the connection to be edited.

2nd Parameter: Array containing the connection information to be edited. See each index below:

Index
Description Example
['server'] Database server $arr_conn['server'] = "127.0.0.1"
['user'] Database user $arr_conn['user'] = "root"
['password'] Database password $arr_conn['password'] = "secretpass123"
['database'] Database used by the connection $arr_conn['database'] = "sc_samples"
['persistent'] Defines whether the connection is persistent $arr_conn['persistent'] = "Y" / "N"
['encoding'] Sets the connection encoding $arr_conn['encoding'] = "utf8"

Note: It is not mandatory to edit all the array indices; you can pass only the index you want to change.

Example of macro usage:

$arr_conn = array();

$arr_conn['user'] = "admin2";
$arr_conn['password'] = "admin2pass";
$arr_conn['database'] = "sc_samples2";

sc_connection_edit("sc_conexao", $arr_conn);