I have the following function
PHP Code:
function categories () {
$res = mysql_query('select category from content ORDER BY category');
while($rows = mysql_fetch_array($res)){
$a = array();
foreach ($rows as $row)
{
$foo = explode(',', $row);
$a = array_merge($a, $foo);
echo '<li><a href="/videos/'.$a[0].'" title="'.$a[0].'">'.$a[0].'</a></li>';
}
}
}
It selects the categories out fine, but how do i get it to only display unique categories?
This prints each category everytime its listed in the db I cant use select distinct because some categories contain more than one category : example anal, amateur, blowjob