mnlight has asked for the wisdom of the Perl Monks concerning the following question:
#!/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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Failing when called by another script
by seattlejohn (Deacon) on Mar 08, 2002 at 02:58 UTC | |
|
Re: Failing when called by another script
by rdfield (Priest) on Mar 08, 2002 at 10:22 UTC | |
by davis (Vicar) on Mar 08, 2002 at 12:01 UTC |