Show or hide custom fields by user’s role [frontend]

Yes, it is possible to hide or show custom fields by user’s role.
Use current_user_can() for finding current user role. This function returns true if current user has capability or role. For example your current user is “wholesale” then you can use like this:

<?php if( current_user_can('wholesale')) {  ?> 
    // stuff here for wholesale
<?php } ?>

For more reference check this: https://codex.wordpress.org/Function_Reference/current_user_can

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