How to pass argument to wp_footer hook with data from a template

The best way of passing PHP variables to JavaScript is using wp_localize_script, which helps to localizes a registered script with data for a JavaScript variable.

Here is a solution in StackOverflow, from where you can get idea to fix your problem.

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