Getting Featured Image Caption to Only Show if Populated

In if ($thumbnail_image && isset($thumbnail_image[0])) { – should $thumbnail_image[0] not be $thumbnail_caption.

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