How to remove notice inside search.php when no results are found?

get_post() returns the post object to the loop. So when you look for its ->ID if no object is there you try to make php to look for ID of nothing, and it gives you the notice. Change post->ID for

    if( ! get_post() )

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