wp_insert_posts add title with count of posts plus one

The problem was that I can’t get wp_count of my custom post type. The result was that I got nothing.

I found this solution

$args = array(
'post_type' => 'orders'
);
$count = new WP_Query( $args );
$orders = $count->found_posts +1;

After this I insert my post

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