appeland Posted August 17, 2006 Share Posted August 17, 2006 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 [b]"select <column> from <table> but only one of each"[/b] :) ?Thanks & Regards,Andi Quote Link to comment https://forums.phpfreaks.com/topic/17869-mysql-query-help-please/ Share on other sites More sharing options...
trq Posted August 17, 2006 Share Posted August 17, 2006 Use a group by. Quote Link to comment https://forums.phpfreaks.com/topic/17869-mysql-query-help-please/#findComment-76356 Share on other sites More sharing options...
appeland Posted August 17, 2006 Author Share Posted August 17, 2006 thorpe, your're my hero for the day ;D !just in case someone wonders about this as well, here's a tutorial:[url=http://www.tizag.com/mysqlTutorial/mysqlgroupby.php]http://www.tizag.com/mysqlTutorial/mysqlgroupby.php[/url] Quote Link to comment https://forums.phpfreaks.com/topic/17869-mysql-query-help-please/#findComment-76358 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.