Are you trying to group them by the category in an array?
<?
//get result set.
while($row = mysql_fetch_array($result)){
//add each item_id to the array in corresponding category.
$this_fund[$row['category_id']][] = $row['item_id'];
}
//you could then cycle through your results, and print them by the grouping.
foreach($this_fund as $category_id => $item_key){
echo "Cateogry ".$category_id."<br />";
foreach($this_fund[$category_id] as $item_key => $item_id){
echo $item_id."<br />";
}
echo "<br />";
}
?>
That what you're looking for?