Discussion Locked

perl database problem

0 helpful
0 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I wrote a perl script
#!/usr/bin/perl

$first = $field{'first'};
$last = $field{'last'};
$address = $field{'address'};
$email = $field{'email'};
$phone = $field{'phone'};
$user = $field{'user'};
$pass = $field{'pass'};

use DBI;
$dbh = DBI->CONNECT("DBI:ODBC:'driver=Driver do Microsoft Access (*.mdb);
dbq=test.mdb'");

print"this is a test";
$sql = qq{INSERT INTO Dreamcpu(FirstName,LastName,Address,Email,Phone,Username,Password) VALUES ('$first','$last','$adress','$email','$phone','$user','$pass');};

$rc = $dbh->do($sql);

print"$rc record(s) were added.

";

$sth = $dbh->prepare("SELECT ID,FirstName,LastName,Address,Email,Phone,Username,Password FROM Dreamcpu");
$sth->executive();

print"

\n";
print"

\n";
while (@row = $sth->fetchrow_array)
{
print"

";
foreach(@row)
{
print"

";
}
print"

\n";
}
print"

ID First Last Address Email Phone User Password
$_

\n";
print"";

$sth->finish;
$dbh->disconnect;
when i goto the webpage and hit submit i get this error
"CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Can't locate object method "CONNECT" via package "DBI" (perhaps you forgot to load "DBI"?) at"
any ideas to a solution?

0 replies

No replies were posted before this discussion closed.

This discussion is closed to new replies.