I have been comparing 2 tables using JOIN and storing my result in another table called macadd
. Each time I run my code its generating duplicate record in table macadd
. How I can stop same record being stored again and again.
Here is code which is generating duplicates:
$query = mysqli_query($conn, "insert into macadd (mac)
select volley.mac from volley
inner join savedemail on savedemail.email = volley.email");
As This query is comparing the rows. I am completely out of logic here that how can I make a variable out of this sql query. So that using that I can check weather record exist or not