]>
src.bluestatic.org Git - bugdar.git/blob - docs/migrate_custom_fields.php
3 // migrates custom field data from bugvaluefill to bug
7 require_once('global.php');
10 $fields = $db->query("SELECT * FROM " . TABLE_PREFIX
. "bugfield");
11 while ($field = $db->fetch_array($fields))
13 // create the database field
14 $db->query("ALTER TABLE " . TABLE_PREFIX
. "bug ADD custom$field[fieldid] MEDIUMTEXT NULL");
16 // update all the data
17 $data = $db->query("SELECT * FROM " . TABLE_PREFIX
. "bugvaluefill");
18 while ($custom = $db->fetch_array($data))
20 $db->query("UPDATE " . TABLE_PREFIX
. "bug SET custom$field[fieldid] = '" . $db->escape_string($custom["field$field[fieldid]"]) . "' WHERE bugid = $custom[bugid]");