#!/usr/bin/perl -w use strict; use warnings; use CGI qw(:standard); $|++; use DBI; my $DBI; my @row; use Database::Mysql; my $db=Database::Mysql->new(); my $dbh=$db->dbh(); $sql1 = "select id, Date from Ceremony where Location = 'City1' and Status = 'Pending'"; $sth = $dbh->prepare($sql1); $sth->execute or die "SQL Error: $DBI::errstr\n"; while (@row = $sth->fetchrow_array) { our $C_id = $row[0]; our $C_date= $row[1]; my ($y, $m, $d) = split('-', $C_date); $C_date2 = "$m-$d-$y"; our $Part1 = ""; our $option=$Part1 . $C_id . $Part2 . $C_date2 . $Part3 . "\n"; #formats my option for the html select statement our $Part4="\, "; our $option2=$C_date . $Part4; #formats the var city# in the javascript push (@option, $option); push (@option, $option2); } print header; print <<"EOF"; EOF my $sql2 = "select id,PrefLoc from Person where id = 96"; $sth = $dbh->prepare($sql2); $sth->execute or die "SQL Error: $DBI::errstr\n"; while (@row = $sth->fetchrow_array) { our $ID = $row[0]; our $Location = $row[1]; } print <<"EOF";
EOF ####