Redirect search.php to 404.php

You can try to use the wp_query->set_404 and status_header in a condition if no results found.

  global $wp_query;
  $wp_query->set_404();
  status_header(404);

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