Custom post type pagination error

I think next_posts_link() is using the global $wp_query to determine pagination, but you’ve created a new query here. Try passing max_num_pages from your $loop query to it:

next_posts_link( '<span class="nextpost">Next</span>', $loop->max_num_pages );

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