I have a mysql table that looks like this:

id int(11) autoincrement
artist varchar(50)
title varchar(50)

I need to check for any rows that have the same titles.
So for example, if I had the following rows:

1 - Bob - Hello World
2 - Charlie Brown - Theme Song
3 - Joe - Hello World
4 - Joe - Is Cool
5 - Bob - Magic Dude

The query would display Row 1, and Row 3 as duplicates. Any idea how I can do something like this?

Try the following

mysql_query('SELECT * FROM `table` GROUP BY `title`');

That will remove any duplicates from the title column when selecting. Keep in mind it does not delete the data but instead just filters it for the query.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.