diff --git a/phpBB/upgrade_20.php b/phpBB/upgrade_20.php
index 094cc5dedd..4964cf68b1 100644
--- a/phpBB/upgrade_20.php
+++ b/phpBB/upgrade_20.php
@@ -61,6 +61,13 @@ function change_column($db, $table, $column, $type, $null)
echo "ERROR! count not change column $column from table $table. Reason: " . mysql_error(). "";
}
+function del_backup_table($db, $table)
+{
+ $sql = "drop table $table";
+ if (!$r = mysql_query($sql, $db))
+ echo "ERROR! could not delete table $table. Reason: " . mysql_error(). "";
+}
+
function add_column($db, $table, $column, $type, $null)
{
$sql = "alter table $table add $column $type $null";
@@ -110,6 +117,7 @@ if($next)
echo "Backing up the $table_name table...
";
$backup_name = $table_name . "_backup";
+
$table_create = "CREATE TABLE $backup_name (\n";
$r = mysql_query("show fields from $table_name", $db);
@@ -342,6 +350,7 @@ Backups completed ok.
$forum_id = $row['forum_id']; $poster_id = $row['poster_id']; $post_text = $row['post_text']; + $post_text = addslashes('$post_text'); $sql = "insert posts (post_id, topic_id, forum_id, poster_id, post_time, poster_ip) values ($post_id, $topic_id, $forum_id, $poster_id, $post_time, $post_ip)"; @@ -450,6 +459,27 @@ Backups completed ok.
}
+ echo "Delete the backup tables ..
";
+ flush();
+
+ $tables = array("posts" ,
+ "priv_msgs",
+ "sessions" ,
+ "topics" ,
+ "banlist" ,
+ "config" ,
+ "forums" ,
+ "users" ,
+ "access" ,
+ "smiles" ,
+ "words" ,
+ "forum_mods");
+ while (list(, $drop_table) = each($tables))
+ {
+ $backup_name = $drop_table . '_backup';
+ del_backup_table($db, $backup_name);
+ }
+
?>
All Done.