From 57dc0649c9a5ad43e626ca64d4af939c24b05811 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 14 Jan 2006 19:25:43 +0000 Subject: [PATCH] r698: Adding field updateder --- docs/update_field_order_in_bugs.php | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/update_field_order_in_bugs.php diff --git a/docs/update_field_order_in_bugs.php b/docs/update_field_order_in_bugs.php new file mode 100644 index 0000000..2f96280 --- /dev/null +++ b/docs/update_field_order_in_bugs.php @@ -0,0 +1,48 @@ + array( + 5 => 1, + 2 => 2, + 1 => 3, + 3 => 4, + 4 => 5 + ), + + 'severity' => array( + 6 => 1, + 1 => 2, + 2 => 3, + 3 => 4, + 4 => 5, + 5 => 6 + ) +); + +$bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug"); +while ($bug = $db->fetch_array($bugs)) +{ + $db->query("UPDATE " . TABLE_PREFIX . "bug SET priority = " . $fields['priority']["$bug[priority]"] . ", severity = " . $fields['severity']["$bug[severity]"] . " WHERE bugid = " . $bug['bugid']); +} + +$severity = $db->query("SELECT * FROM " . TABLE_PREFIX . "severity"); +while ($thing = $db->fetch_array($severity)) +{ + $db->query("UPDATE " . TABLE_PREFIX . "severity SET severityid = " . rand(10, 100000) . " WHERE severityid = $thing[severityid]"); +} + +$priority = $db->query("SELECT * FROM " . TABLE_PREFIX . "priority"); +while ($thing = $db->fetch_array($priority)) +{ + $db->query("UPDATE " . TABLE_PREFIX . "priority SET priorityid = " . rand(10, 100000) . " WHERE priorityid = $thing[priorityid]"); +} + +$db->query("UPDATE " . TABLE_PREFIX . "severity SET severityid = displayorder"); +$db->query("UPDATE " . TABLE_PREFIX . "priority SET priorityid = displayorder"); + +?> \ No newline at end of file -- 2.43.5