conditional based upon the count of current user’s published custom posts

After further testing it seems my attempt (in my question) works!

<?php if ( 0 == count_user_posts( get_current_user_id(), "CUSTOM_POST_TYPE" ) && is_user_logged_in() ) { ?>
do something
<?php } else { ?>
do something else
<?php } ?>

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