#!/usr/bin/perl -w #Volunteer.pl - Delete dates from Volunteer use strict; use warnings; use diagnostics; use DBI; use CGI; my $query = CGI::new(); my ($dbh, $sth, $sql, $date, $col); my @remove_dates = $query->param("remove"); my $name = $query->param("name"); #my @remove_dates = ("2002-04-21,"); #my $name = "Kari Borer"; $dbh = DBI->connect ("DBI:mysql:host=localhost;database=mnlight_MNLIGH +TNING", "mnlight","password", {PrintError=> 0, RaiseError=> 1}); print $query->start_html; # undo the the dates signed up this session. foreach $date ( @remove_dates ) { $sql = "update Volunteer set Volunteer = 'TBD' WHERE Date = '$ +date' and Volunteer = '$name'"; $sth = $dbh->prepare($sql) || die "prepare: $$sql: $DBI::errst +r"; $sth->execute || die "execute: $sql->[0]: $DBI::errstr"; print $query->h1({-align=>'center'}, "You are no longer signed + up for this date $date"); } #end foreach loop $sth->finish (); $dbh->disconnect (); print $query->h2({-align=>'center'}, $query->a({href=>'../BobSchedule.pl'}, 'BOBS SCHEDULE'), + ' ',); $query->end_html; exit(0)
In reply to Failing when called by another script by mnlight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |