yo, a quick hack to get your stuff working...
note: that select statement gives the impression that the categories are already stored in the database as one category per row, but i guess not.
PHP Code:
function categories () {
$res = mysql_query('select category from content ORDER BY category');
while($rows = mysql_fetch_array($res)){
$dirty_array = array();
$clean_array = array();
foreach ($rows as $row)
{
$foo = explode(',', $row);
$dirty_array = array_merge($dirty_array, $foo);
}
// loop through the crappy array
foreach ($dirty_array as $element)
{
// quick hack to bypass duplicates
if (!in_array($element,$clean_array)
{
// push the category element into array
array_push($clean_array,$element);
// quick hack to print out links without re-looping through clean-array
echo '<li><a href="/videos/'.$category.'" title="'.$category.'">'.$category.'</a></li>';
}
}
}
}