Ok, I making a website and there are "teams", the host of this team can add or remove users from the team.
Each team is a row in my SQL table, and I would like to store an array whit each member of the team in this row. When the host add or remove a member I want to take this array from the database edit it and put it back to the database.
Im using PDO.
$member_array = $bdd->query("SELECT members_array FROM teams WHERE ID = 1 ");
$member_array = $member_array->fetch();
Then I modify $member_array (here is where I need help)
$insert_new_array = $bdd->prepare('INSERT INTO squads($member_array) VALUES(:$member_array)');
$insert_new_array -> execute(array( [...] ));
Is this the right way to do what I want?
Thank you.