I have a little query, which is displaying a text if the server query_string exits in the database. It works with all sorts of text an figures in mysql, instead of email adresses. For example if the url looks like "example.com/query.php?test" it works. If there is an email like "example.com/query.php?test@gmail.com" it doesn't work. My DB table type is varchar(100).
Any idea?
<?php
$subscriber_email = ($_SERVER['QUERY_STRING']);
mysql_connect("server", "user", "pswd") or die (mysql_error ());
mysql_select_db("newsletter") or die(mysql_error());
$sql = "SELECT * FROM `newsletter submit` WHERE ID='test@gmail.com'";
$query = mysql_query($sql);
echo mysql_error();
echo (mysql_num_rows($query) == 0) ? 'NO' : 'YES';
?>