science-ation/db/db.update.117.php
dave 87c845c048 - convert the registrations_id in the question answers to the new users_id (it's really the users id anyway)
- add a 117 script to cleanup all the post 116 stuff, deleting unneeded tables and whatnot
- these are NOT THE FINAL scripts, more will be added to these.
2008-10-17 20:38:01 +00:00

32 lines
630 B
PHP

<?
function db_update_117_post()
{
global $config;
$qmap = array('years_school' => 'Years School',
'years_regional' => 'Years Regional',
'years_national' => 'Years National',
'willing_chair' => 'Willing Chair');
foreach($qmap as $field=>$head) {
$q = mysql_query("SELECT id FROM questions WHERE db_heading='{$head}'");
while($i = mysql_fetch_object($q)) {
$id = $i->id;
/* Drop all answers for this question */
mysql_query("DELETE FROM question_answers
WHERE questions_id='$id'");
}
/* Now dump the question itself */
mysql_query("DELETE FROM questions
WHERE id='$id'");
}
}