title: PHP error (500 internal sever error) while using $stmt->get_result()->fetch_assoc();
body: <p>I have a function which works like this</p>
  <pre><code>public function get_user_by_email($email)
  {
      $stmt = $this-&gt;con-&gt;prepare(&quot;SELECT * FROM `user` WHERE `email` = ? &quot;);
      $stmt-&gt;bind_param(&quot;s&quot;, $email);
      $stmt-&gt;execute();
  
      return $stmt-&gt;get_result()-&gt;fetch_assoc();
  }
  </code></pre>
  <p>The problem is whenever I call this function with any email(whether it existed on the database or not) it throws internal server error 500. I'm using a live hosting server and Postman to test this. Can someone help?</p>