Jump to content

how to list MySQL repeated data


plodos

Recommended Posts

select name,title from person

 

output

record no: 300 
title   : aaaaaaaaaaaaaaaaaaaa
name: George Borks

record no: 301 
title   : aaaaaaaaaaaaaaaaaaaa
name: George Borks

record no: 302 
title   : aaaaaaaaaaaaaaaaaaaa
name: George Borks

..........
........
.......

 

For exapmle, George Borks registered 3 times....and when I listed data, there are 3 records, It is not good to see repeated records on the web page..

 

How can I listed only one ( without repeated George Bush),

Link to comment
https://forums.phpfreaks.com/topic/121087-how-to-list-mysql-repeated-data/
Share on other sites

this is working.....
$data = mysql_query("select * from person where no='1' ORDER BY person_id DESC"); 

problem is here
$data = mysql_query("select * from person where no='1' AND UNIQUE(email) ORDER BY person_id DESC"); 

 

I got an error like : mysql fetch array worning, supplied argument like that...

How can I solve the problem?

 

 

You should prevent duplicate input into the table if you don't need them but to fix the solution now you can try adding on to your WHERE clause a UNIQUE(field name) such as

Select name, title from `person` Where UNIQUE(Name)

That's not valid syntax.

 

take the query into phpmyadmin and work on it

So it won't work.

 

As for the actual question, you need to decide which one of the three records you want to use.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.