作者:雯颜哥_135 | 2023-08-15 14:00
我承认自从我使用Perl已经有一段时间了,但这让我很难过.
这是问题所在:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use DBI;
print "Content-type: text/html\n\n";
print "";
my $login = "admin@xxxxx.com";
my $dbfile = "/var/www/shopsite-data/shopsite_db";
my $sql = qq`SELECT ss_OrderID FROM ss_ORDER WHERE ss_Email=?`;
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile", "", "") || die "Cannot connect: $DBI::errstr";
my $sth = $dbh->prepare($sql);
$sth->execute($login) or die $sth->errstr();
while (my @result = $sth->fetchrow_array()) {
print "OrderID: $result[0]
";
}
$sth->finish;
print "