I have a function which works like this
public function get_user_by_email($email)
{
$stmt = $this->con->prepare("SELECT * FROM `user` WHERE `email` = ? ");
$stmt->bind_param("s", $email);
$stmt->execute();
return $stmt->get_result()->fetch_assoc();
}
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?