The WHERE email == '$email' part of the query should be WHERE email = '$email' - SQL uses single equals sign as a comparison operator.
WHERE email == '$email'
WHERE email = '$email'
As for the results, try using mysqli_fetch_assoc.
Also, for passwords, don't use sha1. Use the password_hash and password_verify functions instead, as they're much more secure.
sha1
password_hash
password_verify
Thank you Martin for your reply, also thanks for the notice on using password_hash instead. I will try this now!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The
WHERE email == '$email'
part of the query should beWHERE email = '$email'
- SQL uses single equals sign as a comparison operator.As for the results, try using mysqli_fetch_assoc.
Also, for passwords, don't use
sha1
. Use thepassword_hash
andpassword_verify
functions instead, as they're much more secure.Thank you Martin for your reply, also thanks for the notice on using password_hash instead. I will try this now!