Setting conditional background image from meta value

try using an empty condition

<?php
$bgimage= get_post_meta( $post->ID, 'settings_image', true );
if (!empty($bgimage)) {
    $imgURL = wp_get_attachment_url( $bgimage );
   ?>background: url('<?php echo $img ?>')<?php } ?>

That should work as it checks to see if there is anything stored in the meta and will not print the background: url('') if there is no data.

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