$count_posts->draft & published

In this line you are getting only the count of published items (obviously!!!!):

$published_projects = $count_projects->publish;

You should do something like this:

$count_projects = wp_count_posts( 'apps' );
$published_projects = $count_projects->publish;
$draft_projects = $count_projects->draft;
$total = $published_projects + $draft_projects;

More details and examples in wp_count_posts() reference.

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