title: PHP foreach statement within MySQL select query
body: <p>This is my data</p>
  
  <pre><code>id          cost    cat         foreign     colours
  --------------------------------------------------------   
  385_white   99      swarovski   12          black;blue
  386_white   99      swarovski   12          black;blue;green
  387_white   99      swarovski   12          yellow;green
  389_white   99      swarovski   12          white;silver
  385_white   99      swarovski   12          silver
  </code></pre>
  
  <p>This is my query</p>
  
  <pre><code>$checkSQL=mysql_query("SELECT * FROM `products`");
  while($r = mysql_fetch_array($checkSQL)) {
      echo '
          &lt;ul class="ColourList"&gt;
              &lt;li class="$row"&gt;$row&lt;/li&gt;
          &lt;/ul&gt;
      ';
  }
  </code></pre>
  
  <p>Pseudo code - this should split the list into unique <code>li</code></p>
  
  <pre><code>foreach ($r["colours"] as $key){
                          $key = explode(";", $r["colours"]);
                          &lt;li class="$key"&gt;&lt;/li&gt;
                      }
  </code></pre>
  
  <p>I want to create a list <code>li</code> item for each colour in the table row, so basically split the colon into separate rows - think it is <code>explode</code>? </p>