2009-09-09 00:26:12 +00:00
|
|
|
<?
|
|
|
|
function db_update_117_post()
|
|
|
|
{
|
2025-01-29 03:30:48 +00:00
|
|
|
global $config, $pdo;
|
2009-09-09 00:26:12 +00:00
|
|
|
|
|
|
|
$qmap = array('years_school' => 'Years School',
|
2025-01-29 03:30:48 +00:00
|
|
|
'years_regional' => 'Years Regional',
|
|
|
|
'years_national' => 'Years National',
|
|
|
|
'willing_chair' => 'Willing Chair');
|
2009-09-09 00:26:12 +00:00
|
|
|
|
2025-01-29 03:30:48 +00:00
|
|
|
foreach ($qmap as $field => $head) {
|
2025-02-04 21:48:23 +00:00
|
|
|
$q = $pdo->prepare("SELECT id FROM questions WHERE db_heading=?");
|
|
|
|
$q->execute([$head]);
|
2025-01-29 03:30:48 +00:00
|
|
|
while ($i = $q->fetch(PDO::FETCH_OBJ)) {
|
2009-09-09 00:26:12 +00:00
|
|
|
$id = $i->id;
|
|
|
|
|
|
|
|
/* Drop all answers for this question */
|
2024-12-12 16:24:45 -05:00
|
|
|
$stmt = $pdo->prepare("DELETE FROM question_answers
|
2025-02-04 21:48:23 +00:00
|
|
|
WHERE questions_id=?");
|
|
|
|
$stmt->execute([$id]);
|
2025-01-29 03:30:48 +00:00
|
|
|
}
|
2009-09-09 00:26:12 +00:00
|
|
|
|
|
|
|
/* Now dump the question itself */
|
2024-12-12 16:24:45 -05:00
|
|
|
$stmt = $pdo->prepare("DELETE FROM questions
|
2025-02-04 21:48:23 +00:00
|
|
|
WHERE id=?");
|
|
|
|
$stmt->execute([$id]);
|
2009-09-09 00:26:12 +00:00
|
|
|
}
|
|
|
|
}
|