Check email to be unique php
<p>I am creating a website about music and at the bottom of my website I have a form that has only email submission. I am doing this in order to gather email from the users. </p>

<p>Moreover, I have created a database and in that database I have created a table called emails with only 2 columns:<code>id</code>and <code>email</code>. </p>

<p>I would like to make the emails that I receive unique, because now that I am testing it I can put many emails with the same name. I have tried some coding in order to achieve this but no luck so I will post only the code I have at the moment, so you can help me with what I need to add in that code in order to receive a unique email address.</p>

<p>P.S I will update my database from mysql to mysqli at the end of the project.</p>

<p>Here is my current code:</p>

<pre><code>&lt;?php 
error_reporting(E_ERROR | E_PARSE);
include('../database/db.php');
$email = $_POST['email'];

if($email != "") {
$sql = mysql_query ("INSERT INTO emails (email) VALUES ('$email')");
echo "Thank you for Submitting. Redirecting back to Home Page";
}
?&gt;
</code></pre>