Duplicate Data from two column
You need a compound unique index.

Suppose your table is called photos. You can do this:

CREATE TABLE photos_new LIKE photos;
ALTER TABLE photos_new ADD UNIQUE INDEX pid_tid_index (pid,tid);
INSERT IGNORE INTO photos_new SELECT * FROM photos;
ALTER TABLE photos RENAME photos_old;
ALTER TABLE photos_new RENAME photos;


If it works out, then run

DROP TABLE photos_old;


Give it a Try !!!