Tabular For Many To Many

Hello, Can someone help me to make a tabular input for many to many relationship? I’m just new here in yii and I’m not very good right now in coding here so bare with me thank you. :)

I have three tables named game, team and players.

ex. In 1 game I want to have multiple teams/players

game >|–|< team >|–|<players.

there thanks