$output = array();
$query = mysqli_query($connect, "SELECT * FROM TABLO ORDER BY id ASC");
while($fetch = mysqli_fetch_array($query)){
$name = $fetch['name'];
$output[$name] .= $fetch['nesne'] . '-' $fetch['nesne_renk'] . '-';
}
print_r($output);
?>