My page works as follows:
- A coach logs onto an admin page of a sports team
- He can then select his team for a forthcoming fixture
- The team is displayed in a dropdown menu. With a different dropdown menu for each different position. Thus ensuring only players relevant to a specific position is displayed in the dropdown menu
- Now the coach selects his team
- He then selects the opponents against whom the selected team will play
- He then clicks submit
When he clicks submit the isset() function is triggered which will upload the selected team to the selected_team table in my db
Ok that is easy enough and it is working. Here is my problem, lets say the coach wants to change his selection for a certain fixture. He then goes to the selection page again and redo the whole process described above. But what now happens is that the same fixture_id for opponents is uploaded to the database (only with different playernames where he changed his selection)
Example: Where Selection has been changed for a fixture
Notice: How that the old data from 1st selection is still there and the new data from second selection just gets added to the table
What im looking for is, should the user re select a team for a certain fixture I want the new teams data to replace the old teams data. How do I go about doing this?
Please note this is a fictional database