Correction de bug : getLastIndex
continuous-integration/drone/push Build is passing Details

ServeurDeTest
Noé GARNIER 2 years ago
parent 746fbb2f3b
commit b064420356

@ -236,6 +236,9 @@ class ResoudreGateway
$this->con->executeQuery($query, array( $this->con->executeQuery($query, array(
"partie" => array($idPartie, SQLITE3_INTEGER))); "partie" => array($idPartie, SQLITE3_INTEGER)));
$results=$this->con->getResults(); $results=$this->con->getResults();
if (empty($results)) {
return 0;
}
return $results[0]['max(indexEnigme)']; return $results[0]['max(indexEnigme)'];
} }
} }

@ -242,7 +242,7 @@ class UserController
$idPartie = $_GET['idPartie']; $idPartie = $_GET['idPartie'];
$index = $_GET['index']; $index = $_GET['index'];
$lastIndex = $model->getLastIndex($idPartie); $lastIndex = $model->getLastIndex($idPartie);
if($index == $lastIndex + 1){ if($lastIndex != 0 && $index == $lastIndex + 1){
require($rep . $vues['gameEnd']); require($rep . $vues['gameEnd']);
} }
else{ else{

Loading…
Cancel
Save