How do we restrict a user to see a field in a post without registration,

I assume you mean on the front end;

<?php
    if (is_user_logged_in()) {
        // Only visible when logged in
    } else {
        // Only visible when not logged in
    }
?>

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