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.
30 lines
1.2 KiB
30 lines
1.2 KiB
<?php
|
|
|
|
|
|
require_once('../BDD/SqliteDb.php');
|
|
$db = new SqliteDb('o');
|
|
|
|
|
|
$sqliteQuery = $db->prepare('SELECT type FROM Type WHERE numQuestion=? AND numTp = ?');
|
|
$sqliteQuery->bindParam(1, $_GET['numQuestion']);
|
|
$sqliteQuery->bindParam(2, $_GET['numTp']);
|
|
$result = $sqliteQuery->execute();
|
|
$typeRow = $result->fetchArray();
|
|
|
|
if($typeRow['type'] == 'query'){
|
|
$sqliteQuery = $db->prepare('DELETE FROM Correct WHERE numquestion= ? AND numTp=? ');
|
|
$sqliteQuery->bindParam(1, $_GET['numQuestion']);
|
|
$sqliteQuery->bindParam(2, $_GET['numTp']);
|
|
$result = $sqliteQuery->execute();
|
|
}
|
|
else {
|
|
$sqliteQueryF = $db->prepare('DELETE FROM FunctionCorrect WHERE numquestion= ? AND numTp=?');
|
|
$sqliteQueryF->bindParam(1, $_GET['numQuestion']);
|
|
$sqliteQueryF->bindParam(2, $_GET['numTp']);
|
|
$result = $sqliteQueryF->execute();
|
|
}
|
|
|
|
$sqliteQuery = $db->prepare('DELETE FROM Type WHERE numquestion= ? AND numTp=? ');
|
|
$sqliteQuery->bindParam(1, $_GET['numQuestion']);
|
|
$sqliteQuery->bindParam(2, $_GET['numTp']);
|
|
$result = $sqliteQuery->execute(); |