Greetings:
I am teaching myself PERL, but ran into this problem when executing a script from the tutorial:
System: WIN32
OS: WIndows 2000
Script:
use warnings;
use strict;
use DBI;
my ($dbh, $sth);
$dbh=DBI->connect('dbi:mysql:test', 'root', 'password')
die "Error opening database: $DBI::errstr\n";
$sth=$dbh->prepare("CREATE TABLE checkin (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(32) NOT NULL,
lastname VARCHAR(32) NOT NULL,
checkedin INTEGER,
numberofbags INTEGER,
destination VARCHAR(32) NOT NULL)" );
$sth=execute();
$sth->finish();
print "All done\n";
$dbh->disconnect || die "Failed to disconnect\n";
Error:
Undefined subroutine &main::execute called at create.pl line 18.
Thanks!
I am teaching myself PERL, but ran into this problem when executing a script from the tutorial:
System: WIN32
OS: WIndows 2000
Script:
use warnings;
use strict;
use DBI;
my ($dbh, $sth);
$dbh=DBI->connect('dbi:mysql:test', 'root', 'password')
die "Error opening database: $DBI::errstr\n";
$sth=$dbh->prepare("CREATE TABLE checkin (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(32) NOT NULL,
lastname VARCHAR(32) NOT NULL,
checkedin INTEGER,
numberofbags INTEGER,
destination VARCHAR(32) NOT NULL)" );
$sth=execute();
$sth->finish();
print "All done\n";
$dbh->disconnect || die "Failed to disconnect\n";
Error:
Undefined subroutine &main::execute called at create.pl line 18.
Thanks!