Table user
+---------------+---------------+------------+
| user_id | username | user_level |
+---------------+---------------+------------+
| 1 | superadmin | admin |
| 2 | subadmin | admin |
| 3 | team1 | team |
| 4 | team2 | team |
| 5 | team3 | team |
| 6 | customer1 | customer |
| 7 | customer2 | customer |
| 8 | customer3 | customer |
| 9 | customer4 | customer |
+---------------+---------------+------------+
Table complaint:
+---------------+---------------+------------+
| complaint_id | complaint | user_id |
+---------------+---------------+------------+
| 1 | os issue | 7 |
| 2 | USB issue | 8 |
| 3 | OS currepted | 7 |
| 4 | HD issue | 9 |
| 5 | DVD issue | 6 |
| 6 | SW problem | 9 |
| 7 | Network issue| 9 |
| 8 | system issue | 6 |
+---------------+---------------+------------+
Table assign_work
+---------------+------------+
| complaint_id | user_id |
+---------------+------------+
| 1 | 3 |
| 2 | 4 |
| 3 | 5 |
| 4 | 3 |
| 5 | 4 |
| 6 | 5 |
| 7 | 3 |
| 8 | 4 |
+---------------+------------+
When customer raise the complaint data should save in complaint table also that last
complaint_id should save in assign_work table at the same time
user_id also save sequencially, fetch from user table who are the team that person id only.
I m new one please any one help me.