This is probably easy but when I searched I only found solutions to finding dupes in one table while inserting.
I have two tables. I need to compare one field in both tables. If the record exists in table 2 I must delete it from table 1
I tried to just select the duplicate records with
$sql = "SELECT mainfile.test.telephone FROM mainfile_test WHERE mainfile_test.telephone=mainfile.telephone";
I also tried the delete like so...
$sql = "DELETE FROM mainfile_test WHERE mainfile_test.telephone=mainfile.telephone";
What am I doing wrong?