how can i count or merge same data from the database? here is my code but this wont work..help please..
<?php
$result = mysql_query("SELECT category FROM inventory");
while($row = mysql_fetch_array($result)){
$cat_array = array($row['category']);
foreach ($cat_array as $value){
if ($value<=1){
echo $value . "</br>";
}else{}
}
}
?>
and my output is this..how can i make same value echoed as one? or disregard the duplicate one..
- speaker
accessory
lights
tweeter - speaker