Jump to content


Photo

mysql query help please


  • Please log in to reply
2 replies to this topic

#1 appeland

appeland
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 17 August 2006 - 05:39 PM

Hello,
since our local IT department does not allow us to have mp3's on our
workstations at work I have written a few php scripts that upload and stream
mp3's directly out of a mysql DB. The scripts work great and the performance is
also fine since it runs in the LAN and the IT department can scan themselfs silly, they will not
find any mp3's :)

However, one function still makes me headaches.
I want to make a drop-down box for artist and genre (making the drop down box itself is not a problem)
If I now do a select to the genre or artist column of the DB I obviously get the same artists and genre as often as it's there.

I have googled myself to bits now and just cant find an answer to this or I just dont know
what to search for.

Is there a query like "select <column> from <table> but only one of each" :) ?

Thanks & Regards,
Andi




#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 17 August 2006 - 05:41 PM

Use a group by.

#3 appeland

appeland
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 17 August 2006 - 05:49 PM

thorpe, your're my hero for the day  ;D !

just in case someone wonders about this as well, here's a tutorial:
http://www.tizag.com...ysqlgroupby.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users