removing doubles from mysql_query results.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
VisionsOfCody
Forum Commoner
Posts: 30
Joined: Sat Mar 01, 2003 1:19 pm
Location: France

removing doubles from mysql_query results.

Post by VisionsOfCody »

Hi
this is probably dead simple but i CAN'T find the answer - i have a column in my table that has the same entry on several lines - what i'd like to do is just have one of each type of entry in the <select> list generated using the results.
How can i test the results to get rid of the 'clones' in the results?
thanks muchly
:D
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

You probably want to do a select distinct...
User avatar
puckeye
Forum Contributor
Posts: 105
Joined: Fri Dec 06, 2002 7:26 pm
Location: Joliette, QC, CA
Contact:

Post by puckeye »

Or you could use GROUP BY column in your query.
VisionsOfCody
Forum Commoner
Posts: 30
Joined: Sat Mar 01, 2003 1:19 pm
Location: France

Post by VisionsOfCody »

Thanks Puckeye and Hedge!
SELECT DISTINCT - brilliant!! - that did the job!!
thanks :D :D
Post Reply