Display search results within the same page in wordpress

Can you explain how did you put the search form? Are you working in code or with any page builders?

Assuming you are using code, best case is to use Javascript / Ajax to search in the same page.

Other options include submitting the search form and reloading the page with data. You can add form submit action like this to submit your search form to the same page.

 <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
    // your search input here
 </form>

Then in the same page, you catch the form submission like this and show the results.

if ($_SERVER['REQUEST_METHOD'] === 'POST'){
    enter code here
}

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