Here's an example I worked out. It doesn't require PHP, only direct mySQL commands you can feed into phpMyAdmin:
-- create a test table to demonstrate the solution
CREATE TABLE addresses (
fname VARCHAR(32),
lname VARCHAR(32),
email VARCHAR(32)
);
-- populate the table with a few duplicate values
INSERT INTO addresses VALUES("John", "Smith", "
[email protected]");
INSERT INTO addresses VALUES("John", "Smith", "
[email protected]");
INSERT INTO addresses VALUES("John", "Smith", "
[email protected]");
INSERT INTO addresses VALUES("Joe", "Smith", "
[email protected]");
INSERT INTO addresses VALUES("Joe", "Smith", "
[email protected]");
INSERT INTO addresses VALUES("Jim", "Smith", "
[email protected]");
-- create a temporary table for the unique values
CREATE TEMPORARY TABLE temp LIKE addresses;
INSERT INTO temp(SELECT DISTINCT * FROM addresses);
-- clear the original table and load the unique values there
DELETE FROM addresses;
INSERT INTO addresses(SELECT DISTINCT * FROM temp);
DROP TABLE temp;