If you are facing a problem with duplicate data, follow the steps below to delete duplicate rows from the database using phpMyAdmin.
- Open phpMyAdmin.
- Go to your database.
- Click on the SQL menu at the top.
- Run the query below.
DELETE a FROM products a INNER JOIN products b WHERE a.id < b.id AND a.item_id = b.item_id
Here a.item_id = b.item_id is the column that identifies a duplicate — change it to your own column name. The query keeps the row with the highest id and deletes the rest.
