// New Helper to use the functions $id=$_GET["id"]; $Tour= new TournamentsModel(); // Performing a select with all "*" and specifiying the TournamentId to edit $results = $Tour->SelectSpecific("*",array( "TournamentId" => $id )); $results=$results[0]; //If an edit is performed if(! empty($_POST)) { $data=$_POST; $answer=$Tour->Update($data,array( "TournamentId" => $id )); header("Location: ./index.php"); } ?> <h4>Ajouter un tournoi</h4> <form method="post"> <select name="TournamentYear"> <option value="<? echo $results["TournamentYear"]; ?>"><? echo $results["TournamentYear"];?></option> <? foreach ($TourYear as $Year):?> <? if ($Year==$results["TournamentYear"]) continue; ?> <option value="<? echo $Year; ?>"><? echo $Year;?></option> <? endforeach;?>