diff --git a/checkin_notes b/checkin_notes
index b09a7ed49d..17c0f1d0f3 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -5917,3 +5917,17 @@ Rom 11 Aug 2010
win_build/
libboinc_staticcrt.vcproj
+
+David 11 Aug 2010
+ - admin: add script for deleting results with no workunit.
+ There were ~1,400 of these on SETI@home,
+ presumably because of a bug at some point in the past.
+ html/
+ ops/
+ delete_orphan_results.php
+ profile_screen_form.php
+ inc/
+ boinc_db.inc
+
+ sched/
+ db_purge.cpp
diff --git a/html/inc/boinc_db.inc b/html/inc/boinc_db.inc
index 0ff0ce4fef..5e05d50766 100644
--- a/html/inc/boinc_db.inc
+++ b/html/inc/boinc_db.inc
@@ -223,6 +223,10 @@ class BoincResult {
$db = BoincDb::get();
return $db->lookup_id($id, 'result', 'BoincResult');
}
+ function delete() {
+ $db = BoincDb::get();
+ return $db->delete($this, 'result');
+ }
}
class BoincWorkunit {
diff --git a/html/ops/delete_orphan_results.php b/html/ops/delete_orphan_results.php
new file mode 100755
index 0000000000..3ec3543440
--- /dev/null
+++ b/html/ops/delete_orphan_results.php
@@ -0,0 +1,32 @@
+workunitid);
+ if ($wu) {
+ echo "$r->id has a WU\n";
+ $found = true;
+ break;
+ } else {
+ echo "$r->id has no WU - deleting\n";
+ $ndel++;
+ $r->delete();
+ }
+ }
+ if ($found) break;
+}
+echo "Done - deleted $ndel results\n";
+
+?>
diff --git a/html/ops/profile_screen_form.php b/html/ops/profile_screen_form.php
index 9b8a46f8bd..b91d1f9c11 100644
--- a/html/ops/profile_screen_form.php
+++ b/html/ops/profile_screen_form.php
@@ -71,7 +71,7 @@ while ($profile = mysql_fetch_object($result)) {
";
echo "