android - I keep getting error on fetch_assoc() in PHP -
i trying create login/register feature on android app. 1 of files contains 2 functions being used register , login. keep getting error, same error when try both. getting error error_log file , have tried google while , can't seem find solution particular issue. error is:
call member function fetch_assoc() on non-object in db_functions.php
and parts error here:
login:
public function getuserbyemailandpassword($email, $password) { $stmt = $this->conn->prepare("select * users email = ?"); $stmt->bind_param("s", $email); if ($stmt->execute()) { $user = $stmt->get_result()->fetch_assoc(); <----this line $stmt->close(); return $user; } else { return null; } }
register:
if ($result) { $stmt = $this->conn->prepare("select * users email = ?"); $stmt->bind_param("s", $email); $stmt->execute(); $user = $stmt->get_result()->fetch_assoc(); <----and line $stmt->close(); return $user; } else { return false; }
Comments
Post a Comment