I am taking email input from users and storing it in database and I want to avoid duplicate entry. The code I am currently using giving me Deprecated: mysql_query() and mysql_num_rows() expects parameter 1 to be resource Warnings and executing else part of the program please anyone correct my mistake here
$value = $_POST['input1'];
$query = mysql_query("SELECT * FROM savedemail WHERE email='$value'");
if(mysql_num_rows($query) > 0)
{
echo "Username already exists";
}
else{
echo "else-part";
}
$conn->close();