table data on this type image My array is $otaDetails which prints
Array ( [0] => Array ( [OtherOtaBooking] => Array ( [id] => 1 [listing_id] => 0 [event_id] => 123testing [first_name] => [last_name] => [email_id] => [phone_number] => 0 [title] => [checkin] => 0000-00-00 [checkout] => 0000-00-00 [no_of_guests] => 0 [amount_paid] => 0 [amount_rec] => 0 [reservation_id] => 0 [booking_src] => ) ) [1] => Array ( [OtherOtaBooking] => Array ( [id] => 2 [listing_id] => 0 [event_id] => 123testing [first_name] => testamar 12 [last_name] => [email_id] => [email protected] [phone_number] => 2147483647 [title] => CasaMelhor: 2BHK in Candolim:CM001 [checkin] => 2015-12-16 [checkout] => 2015-12-17 [no_of_guests] => 21 [amount_paid] => 2147483647 [amount_rec] => 111111 [reservation_id] => 0 [booking_src] => asdddddddd ) )
I want to print it in table format
<?php
foreach ($otaDetails as $otaDetail){
echo'<tbody>';
echo'<tr>';
echo'<td>'. $otaDetail['id']."</td>";
echo'<td>'. $otaDetail['listing_id'].'</td>';
echo'<td>'. $otaDetail['first_name'].'</td>';
echo'<td>'. $otaDetail['last_name'].'</td>';
echo'<td>'. $otaDetail['email_id'].'</td>';
echo'<td>'. $otaDetail['phone_number'].'</td>';
echo'<td>'. $otaDetail['title'].'</td>';
echo'<td>'. $otaDetail['checkin'].'</td>';
echo'<td>'. $otaDetail['checkout'].'</td>';
echo'<td>'. $otaDetail['no_of_guests'].'</td>';
echo'<td>'. $otaDetail['amount_paid'].'</td>';
echo'<td>'. $otaDetail['amount_rec'].'</td>';
echo'<td>'. $otaDetail['reservation_id'].'</td>';
echo'<td>'. $otaDetail['booking_src'].'</td>';
echo'<tr>';
echo'</tbody>';
}
?>
However, this gives the error:-
Undefined index: id [APP\Plugin\PropManagement\View\Otherotabookings\index.ctp, line 59]