i'm kind off stuck in this:
mysql table : tableexample with the columns ( flightnumber, company, datearrive, timeleave, timearrive)
Where I generate a array like this:
Array[0]
- Array[0][1] => 1000
- Array[0][2] => Company A
- Array[0][3] => 2014-05-10
- Array[0][4] => 10:00:00
- Array[0][5] => 15:00:00
Array[1]
- Array[1][1] => 2000
- Array[1][2] => Company A
- Array[1][3] => 2014-05-11
- Array[1][4] => 10:00:00
- Array[1][5] => 15:00:00
Array[2]
- Array[2][1] => 3000
- Array[2][2] => Company B
- Array[2][3] => 2014-05-10
- Array[2][4] => 10:00:00
- Array[2][5] => 15:00:00
Array[3]
- Array[3][1] => 4000
- Array[3][2] => Company B
- Array[3][3] => 2014-05-11
- Array[3][4] => 16:00:00
- Array[0][5] => 19:00:00
Then I need to place this in a html table:
<p>....................| 2014-05-10|2014-05-11 |</p>
<p>10:00:00 - 15:00:00 | Company A |...........|</p>
<p>10:00:00 - 15:00:00 | Company B | Company A |</p>
<p>16:00:00 - 19:00:00 | ..........| Company B |</p>
I've already:
populate the head of the table with the dates, but now i'm stuck....
<thead>
<?php
echo "<tr>";
for ($row = 0; $row < 5;) {
$dia=$array[$row][2];
echo "<th>Dia " . $dia . "</th>";
$i=$row;
for ($rownext = ($row+1); $rownext < 5;){
if ($array[$rownext][2]==$dia){
$i++;
};
$rownext++;
};
$row=($i+1);
};
echo "</tr>";
?>
</thead>
;after}, just}is sufficient, just a style thing :)