mysql_query - do not repeat

A

Anonymous

Guest
Is there a way to make the query not repeat the same strings?

I have a cell in a mysql table called genre and there might be more then on genre and i want to make a list of all the genres but it repeats the same genre...

Good example:
hiphop
trance
house

Bad example:
hiphop
hiphop
hiphop
trance
trance
house

Is there a command for mysql_query? or is there some other way?
 
I found one but is there a way to do this with mysql_query();

This is the page that i found :)
http://www.php-forum.com/p/viewtopic.php?p=13026&highlight=repeat#13026

I tryed this but doesn't work a 100%, It doesn't repeat all of them but it repeats some times ;/
 
Hi,

I guess that using:

SELECT DISTINCT genre FROM table

would fit...

Regards.
 
Back
Top