You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2 KiB

<?php
require_once('../BDD/SqliteDb.php');
$db = new SqliteDb('o');
$numQuestion = $_GET['numDemo'];
$numTp = $_GET['numChapitre'];
$numQuestionPrec = $numQuestion-1;
$test = 999;
if(isset($_GET['des'])){
$numQuestion += 1;
$numQuestionPrec = $numQuestion-1;
}
if($numQuestion!=1){
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=?');
$sqliteQuery->bindParam(1, $test);
$sqliteQuery->bindParam(2, $numQuestion);
$sqliteQuery->bindParam(3, $numTp);
$result = $sqliteQuery->execute();
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=?');
$sqliteQuery->bindParam(1, $numQuestion);
$sqliteQuery->bindParam(2, $numQuestionPrec);
$sqliteQuery->bindParam(3, $numTp);
$resulti = $sqliteQuery->execute();
$sqliteQuery = $db->prepare('UPDATE Demonstration SET numDemo=? WHERE numDemo=? AND chapitre=?');
$sqliteQuery->bindParam(1, $numQuestionPrec);
$sqliteQuery->bindParam(2, $test);
$sqliteQuery->bindParam(3, $numTp);
$resultp = $sqliteQuery->execute();
}
//header("Location: index.php");