Doing it manually, I would use:
Code: Select all
/* array of items and sizes
$tagArray = array(
"Apple" => 9,
"Cell Phone" => 12,
"Computer" => 6,
"eBay" => 1,
"Gadget" => 3
);Code: Select all
$query = mysql_query("SELECT * FROM tags ORDER BY count DESC");
// loop through table world counting occurrences of parent
while ($row = mysql_fetch_array($query)) {
$tagArray [$tag] = $count; // tried this and several other variations with no success
}