Hey everybody I want to let you know that I have undertaken the grueling task of getting the heck away from WordPress. I was so sick of the problems and updates I had to do all the time. I am now using my ezbloo system and I am integrating all my old posts into the new system. It sucks, but in the end, I will save bundles of time. I needed to keep things simple and that is why I created ezbloo. I'll have more on this later for you guys after I am done with the total integration of my old posts here. So if you are looking for a post and need it faster, shoot me an email and I will make it a priority. [email protected]

I needed to delete duplicate entries in MySql with PHP. After some trial and error I wrote a script that will do it for me. What I needed to do was delete duplicate email addresses in a email script. Here is the code that made that magic happen.  

 $result = $con->query("SELECT email FROM newsusers group by email having count(*) >= 2") ;
while ($row = $result->fetch_assoc()) {
   $orgemail=$row['email']; 
    echo $orgemail;
    echo '<br/>';
mysqli_query($con,"DELETE FROM newsusers WHERE email='$orgemail' ");
}