Try this
$convert = array();
$customer_key = array();
$hotel_key = array();
$index = 0;
foreach ($results as $row) {
if (!isset($customer_key[$row['customer']])) {
$customer_key[$row['customer']] = $index;
$index++;
}
$key = $customer_key[$row['customer']];
$convert[$key]['customer'] = $row['customer'];
if (!isset($hotel_key[$key])) {
$hotel_key[$key][$row['hotel']] = 0;
}
elseif (!isset($hotel_key[$key][$row['hotel']])) {
$hotel_key[$key][$row['hotel']] = count($hotel_key[$key]);
}
$h_key = $hotel_key[$key][$row['hotel']];
$convert[$key]['children'][$h_key]['hotel'] = $row['hotel'];
$convert[$key]['children'][$h_key]['children'][]= array('roomtype' => $row['roomtype']);
}
print_r($convert);
It should convert your given array to accepted array