How to set a variable in a shortcode and reference it in another shortcode in the same post?

In functions.php, where do you place your shortcode functions, you have to declare a global variable, then set its value in first shortcode function and use its value in second function.

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