Ahoy all! Long story short with this one if you don\'t mind lending a hand to this novice PHPer. :)
I have a database field called \"Categories\" that has this stored:
And just so future onlookers have it .... here is the explode code
$query2 = mysql_query("SELECT * FROM categorytable");
while($row = mysql_fetch_array($query2)){
$categories = html_entity_decode($row['categories']);
$thelist = explode(',', $categories);
foreach($thelist as $order){
if(trim($order) != ''){
$order = trim($order);
$order = ", '".$order."'";
$theorder .= $order;
}
}
and then for the query, just put in the the order variable
SELECT DISTINCT(type), type FROM the_categories ORDER BY FIELD(type" . $theorder .")")