Add review box by function at top or bottom of content

1- Why this function not shown at bottom of content ?

Your filter must return content, not echo content, but you call sandy_reviews() inside the filter callback and sandy_reviews() prints content when it runs. You need to rewrite that function to return content instead of echo it.

2- Why when we used this filter at top of content it’s show review box
at

summary of content at category page !!

Your category archive is using the_content() to display the summaries and your code does nothing to prevent that. You want something like:

add_filter( 'the_content', 'sandy_posts_filter' );
function sandy_posts_filter( $content )
{
  if (!is_single()) return $content;
  // the rest of your code

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