_____________________________________________________sub approve_posts_now { my @key; foreach $key (%form_data) { if ($key =~ /^radio/ && $form_data{$key} eq "Add") { @key = split("," , $key); $sth = $dbh->prepare("INSERT INTO $calendar_table SELECT * + FROM $holding_table WHERE year=? AND month=? AND day=? AND time_start=? AND time_end=? AND tit +le=?"); $sth->bind_param(1, "$key[1]"); $sth->bind_param(2, "$key[2]"); $sth->bind_param(3, "$key[3]"); $sth->bind_param(4, "$key[4]"); $sth->bind_param(5, "$key[5]"); $sth->bind_param(6, "$key[6]"); eval {$sth->execute();}; if (!$@) { $sth = $dbh->prepare("DELETE FROM $holding_table WHERE + year=? AND month=? AND day=? AND time_start=? AND time_end=? AND + title=?"); $sth->bind_param(1, "$key[1]"); $sth->bind_param(2, "$key[2]"); $sth->bind_param(3, "$key[3]"); $sth->bind_param(4, "$key[4]"); $sth->bind_param(5, "$key[5]"); $sth->bind_param(6, "$key[6]"); $sth->execute(); } } elsif ($key =~ /^radio/ && $form_data{$key} eq "Delete") { $sth = $dbh->prepare("DELETE FROM $holding_table WHERE + year=? AND month=? AND day=? AND time_start=? AND time_end=? AND + title=?"); $sth->bind_param(1, "$key[1]"); $sth->bind_param(2, "$key[2]"); $sth->bind_param(3, "$key[3]"); $sth->bind_param(4, "$key[4]"); $sth->bind_param(5, "$key[5]"); $sth->bind_param(6, "$key[6]"); $sth->execute(); } } @success_message = h2({-align=>'center'},"Database(s) updated. Tha +nks!"); success_message(); }
In reply to Rows fail to delete without error by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |