I have a database table that contain several projects. I want to show each project in a tab view. so I want to get each project name once and fetch other details under that project name. My table looks like below.
+-------------+----------+--------------+---------+-------------+
| activity_id | activity | project_name | user_id | description |
+-------------+----------+--------------+---------+-------------+
| 1 | A | New Project | 5 | Project |
| 2 | B | New Project | 5 | Project |
| 3 | C | New Project | 5 | Project |
| 4 | D | New Project | 5 | Project |
| 5 | E | New Project | 5 | Project |
| 6 | A | Old Project | 5 | New one |
| 7 | B | Old Project | 5 | New one |
| 8 | C | Old Project | 5 | New one |
| 9 | A | Another One | 5 | Test 01 |
| 10 | B | Another One | 5 | Test 01 |
| 11 | C | Another One | 5 | Test 01 |
| 13 | D | Another One | 5 | Test 01 |
+-------------+----------+--------------+---------+-------------+
Is there a way to get this table like below array?
['New Project'] =>
[0] =>
['activity_Id'] => '1'
['activity'] => 'A'
['user_id'] => '5'
['description'] => 'project'
[1] =>
['activity_Id'] => '2'
['activity'] => 'B'
['user_id'] => '5'
['description'] => 'Project'
and like vice..?