Printing a variable inside a custom WP_Query

Remove the single quotation, use flowing code. hope it will work

'post_type' => $post_type_name,

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