Delete duplicate rows from mysql in php function

This project was awarded to discocactus for $10 USD.

Get free quotes for a project like this
Project Budget
$25 - $30 USD
Total Bids
Project Description

Hi Coders I have a table in mysql with the following structure

Tablename: tblItems



ItemName -->Varchar(50)

I need to remove all the duplicates but leave one record using a php function.

for example the data is like this:

1 | ABC | 1

2 | XYZ | 1

3 | ABC | 2

So I want to delete the duplicate entry for [ABC] and the end result should looklike this:

1| ABC | 1

2| XYZ | 1

Ideally I would like a php function which I can call from website evry now and then , but if it is easier to implement using sql that is fine too.

Thanks in adavance

Awarded to:

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online