You can merge all the items into one array and then count the values with array_count_values.
I really don't know if this is what you want:
$myarray = Array();
while($row = mysql_fetch_array($result)){
$medic = explode(",", $row['Indication']);
$myarray = array_merge($myarray,$medic);
}
$counts = array_count_values($myarray);
foreach($counts as $key=>$value){
echo "$key = $value";
}
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080