How does one insert a variable value into a “myCRED plugin shortcode [closed]

You can create the shortcode as a string like this :

$rate = 2587.36;
$code = "[mycred_exchange from=\"mycred_default\" to=\"mycred_usd\" min=\"0.00001\" rate=\"$rate\"]";

and then, to execute the code

echo do_shortcode($code);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)