0

Good day all,

    $query = "SELECT hashtag FROM user_information WHERE email != $email";

Does not work.

However, without the where contraints, it works fine

$query = "SELECT hashtag FROM user_information";

I don't think the $email variable is the issue because even replacing it with something like "daniel@gmail.com" does not work.

I want to evaluate only query where the email is different from that of the email post.

This is because I will insert the email into the database, and obviously if this email already exist we do not want to create a second account.

jon220
  • 131
  • 1
  • 4
  • 10

1 Answers1

2

You have to put apostrophes around your variable like:

$query = "SELECT hashtag FROM user_information WHERE email != '$email'";