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
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?

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.