diff options
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-x | editusers.cgi | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/editusers.cgi b/editusers.cgi index b996c139e..6dda0e97a 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -551,9 +551,6 @@ if ($action eq 'search') { } # 2) Whines - my $sth_whineidFromSchedules = $dbh->prepare( - qq{SELECT eventid FROM whine_schedules - WHERE mailto = ? AND mailto_type = ?}); my $sth_whineidFromEvents = $dbh->prepare( 'SELECT id FROM whine_events WHERE owner_userid = ?'); my $sth_deleteWhineEvent = $dbh->prepare( @@ -563,12 +560,8 @@ if ($action eq 'search') { my $sth_deleteWhineSchedule = $dbh->prepare( 'DELETE FROM whine_schedules WHERE eventid = ?'); - $sth_whineidFromSchedules->execute($otherUserID, MAILTO_USER); - while ($id = $sth_whineidFromSchedules->fetchrow_array()) { - $sth_deleteWhineQuery->execute($id); - $sth_deleteWhineSchedule->execute($id); - $sth_deleteWhineEvent->execute($id); - } + $dbh->do('DELETE FROM whine_schedules WHERE mailto = ? AND mailto_type = ?', + undef, ($otherUserID, MAILTO_USER)); $sth_whineidFromEvents->execute($otherUserID); while ($id = $sth_whineidFromEvents->fetchrow_array()) { |