How can i use this meta box function in my template ? (WordPress)

Your missing the prefix:

Make sure you call global $prefix after your query and use $prefix.'checkbox' to your get_post_meta

<?php if ($meta_box = get_post_meta($post->ID, $prefix.'checkbox', true) ) : ?>
Show this when checkbox checked
<?php endif; ?>

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