I have parent and child entries in my database like:
| ID | Team |
| 100 | Team_1 |
| 200 | Team_2 |
| 300 | Team_3 |
And players like
| ID | Team_ID | Player |
| 1 | 100 | Player_1 |
| 2 | 300 | Player_2 |
Now i need a column with auto-incremtent based for every Team. It should start new count every time a new team will be added.
A fontend table should like:
- Team players:
- 100_1 = ...
- 100_2 = ...
- 200_1 = ...
- 200_2 = ...
- 200_3 = ...
- 300_1 = ...
- ...
How to do this in mysql / php?
Thanks.