General discussion

Locked

perl database problem

By wayko ·
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"<html><body><h1>this is a test</h1>";
$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.<p>";

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


print"<table>\n";
print"<tr><th>ID</th><th>First</th><th>Last</th><th>Address</th><th>Email</th><th>Phone</th><th>User</th><th>Password</th>\n";
while (@row = $sth->fetchrow_array)
{
print"<tr>";
foreach(@row)
{
print"<td>$_</td>";
}
print"</tr>\n";
}
print"</table>\n";
print"</body></html>";

$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?

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums