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