Hey guys, So I have a problem that is as follows, I have a table players , a table training and a helper table treadmill (where will I see if some player is currently training) The question is, how can I do that by the time I create a workout, this auxiliary table is populated with the workout ID I just created and the id of the players. For example, in my interface I select a training and select players that will participate, clicking on the button "Start workouts" I want that, besides creating a column in the table training , with auto-increment ID , I want you to create a line with the ID that has just been generated in the player_treater table. I hope I have illustrated well haha. In java it would be using Statement.RETURN_GENERATED_KEYS, but in PHP I no longer handle it. Does anyone know how to do it?