I have the following array that I get from mysql database, after I get all data I should create one table to show all values.
Array
(
[0] => Array
(
[groupNo] => 1001
[name] => james
)
[1] => Array
(
[groupNo] => 1002
[name] => chen
)
[2] => Array
(
[groupNo] => 1002
[name] => ash
)
[3] => Array
(
[groupNo] => 1001
[name] => mark
)
)
My current table is like this one :
Group Number | Name | Action |
-------------+------+---------------------
1001 | James | |
------------+----------------+------------
1002 | chen | |
-------------+---------------+------------
1002 | ash | |
-------------+---------------+------------
1001 | mark | |
-------------+---------------+------------
But what I want is my table look exactly like below :
Group Number | Name | Action |
-------------+------+---------------------
1001 | James | |
+---------------+------------
| Mark | |
-------------+----------------------------
1002 | chen | |
+----------------------------
| ash | |
-------------+----------------------------
Below is my code :
<?php
if (count($sharingGroup) > 0) {
for ($i = 0; $i < count($sharingGroup); $i++) {
$sharingGroupRecord = $sharingGroup[$i];
?>
<tr>
<td>' . $sharingGroupRecord ['groupNo'] .'</td>
<td>' . $sharingGroupRecord ['name'] .'</td>
<td><a name="action" href="#">Action<span>
</span></a>
</tr>
Anybody please help me to solve this.