title: SQL statement not working SELECT 1064 Error in your SQL syntax
body: <p>My SQL statement doesn't work...</p>
  
  <p>Here is my variable:</p>
  
  <pre><code>$email="test@test.com";
  </code></pre>
  
  <p>These statements doesn't work : </p>
  
  <pre><code>$sql = "SELECT * FROM table WHERE email = $email";
  $sql = 'SELECT * FROM table WHERE email = ' . $email;
  </code></pre>
  
  <p>1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@test.com' at line 1</p>
  
  <p>But if I use a string instead of the variable, it works:</p>
  
  <pre><code>$sql = "SELECT * FROM table WHERE email = 'test@test.com'";  
  </code></pre>
  
  <p>What's wrong with my statement?
  Thanks!</p>