php string inside shortcode does not work

this should work

<?php echo do_shortcode('[shortcode_products_by_brand title="Promozioni" per_page="12" columns="4" orderby="title" order="desc" brand="'. $entity->getSlug() .'" operator="IN"]') ?>

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