Have you already connected to the Database? If not, you have to do this:
$db = mysql_connect($mysqlhost, $mysqluser, $mysqlpass);
mysql_select_db($mysqldb, $db);
and then for your query you would go:
$query = mysql_query(\"select id from data where email = \'$email\'\", $db);
Hope this helps