Put php variable in shortcode

Try changing your code to:

<?php echo do_shortcode('[ai1ec tag_name="' . $calendar . '"]'); ?>

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