How many posts does the loop return?

Try reversing the logic, put the dividing line before the post but only do it after the first post.

To answer your question though, you can get the loop count with the following:

global $wp_query;
$count = count( $wp_query->posts );
// or
$count = $wp_query->post_count;

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