PHP, MySQL table query syntax error?
<p>I hope someone can help see what's wrong here:
I have a form with two field <code>EMAIL</code> and <code>PASSWORD</code> that opens a php page where I intend to run a simple query on a table.
I get an error message that makes no sense:<br>
<code>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' at line 1</code>.<br>
The email address I entered in this case did end with '@gmail.com'<br>
Here's the code:</p>

<pre><code>&lt;?php
$dbhost = 'somewhere.net';
$dbuser = 'someUser';
$dbpass = 'pass';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'medreunten_db1';
mysql_select_db($dbname) or die(mysql_error($conn)); 

$email = mysql_real_escape_string($_POST['email']);

$query = "SELECT * FROM employee WHERE email = $email";
$result = mysql_query($query, $conn) or die (mysql_error($conn));
extract(mysql_fetch_assoc($result));  


while ($row = mysql_fetch_array($result)) {
extract($row);
echo $row['name'];
echo $row['surname'];
echo $row['age'];
}
?&gt;
</code></pre>

<p>Any advice would be appreciated.</p>
