How would an if statement surrounding a custom field with two variables (holding values) look like?

<?php if ( $mainbar_left_title && $mainbar_left_image ) : ?>

See http://www.php.net/manual/en/language.operators.logical.php

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