Search result count not matching actual result

If you want to exclude certain posts, wouldn’t the conditional be:

 if ($value != '' &&  get_post_meta($post->ID, 'value', true) != 'value_to_exclude')

Anyhow, you’re excluding AFTER you run the query. So $total_results will always be ‘wrong’.
The better approach is to write sql for WP_Query that does the excluding for you.
But you didn’t include the query, so that cannot be addressed.

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