diff --git a/WEB/Controller/PartieGateway.php b/WEB/Controller/PartieGateway.php index 93f0d721..eb82696c 100644 --- a/WEB/Controller/PartieGateway.php +++ b/WEB/Controller/PartieGateway.php @@ -142,13 +142,16 @@ class PartieGateway ) ); $partie = $this->findLastPartie(); - $query = "INSERT INTO Contenir VALUES (:partie,:idEnigme,1)"; + $query = "INSERT INTO Contenir VALUES (:partie,:idEnigme,:index)"; + $i = 1; foreach ($lesEnigmes as $enigme) { $this->con->executeQuery($query, array( "partie" => array($partie->getIdPartie(), SQLITE3_INTEGER), - "idEnigme" => array($enigme->getIdEnigme(), SQLITE3_INTEGER) + "idEnigme" => array($enigme->getIdEnigme(), SQLITE3_INTEGER), + "index" => array($i, SQLITE3_INTEGER), ) ); + $i++; } $query = "INSERT INTO Participer VALUES (:partie,:utilisateur,0)"; $this->con->executeQuery($query, array(