title: How to insert a double quotes in a variable in php
body: <p>I am trying to send a query like this:</p>
  
  <pre><code>$sql = "SELECT ID FROM loto_users WHERE email=".$email." LIMIT 1";
  echo $sql; //to control
  $result = mysql_query($sql);
  </code></pre>
  
  <p>When I do that, it returns me: </p>
  
  <blockquote>
    <p>SELECT ID FROM loto_users WHERE email=xxx@gmail.com LIMIT 1</p>
    
    <p>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 '@gmail.com LIMIT 1' at line 1</p>
  </blockquote>
  
  <p>Then I tried to run this line in mysql web interface. I copy-paste this:</p>
  
  <pre><code>SELECT ID FROM loto_users WHERE email=xxx@gmail.com LIMIT 1
  </code></pre>
  
  <p>It gave me the same error msg. Then I added double quotes before and after email adress:</p>
  
  <pre><code>SELECT ID FROM loto_users WHERE email="xxx@gmail.com" LIMIT 1
  </code></pre>
  
  <p>Now, it runs... in the interface. I want this in my php file but I have no idea how to create a variable that capable includes double quotes.</p>
  
  <p>Or is there any other way?</p>