I try some codes to build a RESTful API Web Service using PHP and slim framework. (I'm using Advanced Rest Client for testing this code)
This is my codes.
private function isUserExists($email) {
$stmt = $this->conn->prepare("SELECT id from users WHERE email = ?");
$stmt->bind_param("s", $email);
$stmt->execute();
$stmt->store_result();
$num_rows = $stmt->num_rows;
$stmt->close();
return $num_rows > 0;
}
and then I got this error.
Fatal Error : Call to a member function bind_param() on a non-object on Line 113
Line 113 is : $stmt->bind_param("s", $email);
I've been looking for a solution of this problem since 2 weeks ago.
Thanks before guys :))