title: How do I select distinct values from multiple mysql columns and put them in one PHP array?
body: <p>I have a table for songs, where each song can have up to 3 different genres. So in my table, for each song I have column genre1, genre2, and genre3. I'm trying to display all the genres available in a list.</p>
  
  <p>Here's a random example set:</p>
  
  <pre><code>genre1    genre2    genre3
  metal     jazz
  metal     country   pop
  oldies    metal
  rap
  jazz      hip-hop   choir
  choir     metal     jazz
  </code></pre>
  
  <p>I want the list, done in php, to display in alphabetical order the available distinct genres to choose from. So it should list this:</p>
  
  <ul>
  <li>Choir</li>
  <li>Country</li>
  <li>Hip-hop</li>
  <li>Jazz</li>
  <li>Metal</li>
  <li>Oldies</li>
  <li>Pop</li>
  <li>Rap</li>
  </ul>
  
  <p>All help is appreciated. Perhaps I'm not going about this the smartest way, but I couldn't think of a better way.</p>