I'm a novice to cgi programming, and have my first problem. I'm trying to display some data from a database using the script below. I'm receiving the following error from apache:
[Sat Jun 15 11:17:15 2002] [error] [client 142.214.184.25] Premature end of script headers: /
Here is the script.
#!/usr/bin/perl -w
use DBI;
my ($i, $sth, $dbh, @row, @storage);
$dbh = DBI->connect("dbi:Oracle:ORACLE","scott", "tiger", {
PrintError => 0,
RaiseError => 1
} );
$sth = $dbh->prepare("select author.author_number, author_last,author_first, book_code, sequence_number
from author, wrote
where author.author_number = wrote.author_number"
$sth->execute();
$i=0;
while (@row = $sth->fetchrow_array()){
$storage[$i] = "@row";
$i++;
}
$dbh->disconnect();
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD><TITLE>Database Output</TITLE></HEAD>\n";
print "<BODY>\n";
foreach (@storage){
print $_ . "<br>\n";
}
print "</BODY>\n";
print "</HTML>\n";
I'm about to start reading CGI Programming; I thought I would try somthing first.
Thanks,
StickyBit.
[Sat Jun 15 11:17:15 2002] [error] [client 142.214.184.25] Premature end of script headers: /
Here is the script.
#!/usr/bin/perl -w
use DBI;
my ($i, $sth, $dbh, @row, @storage);
$dbh = DBI->connect("dbi:Oracle:ORACLE","scott", "tiger", {
PrintError => 0,
RaiseError => 1
} );
$sth = $dbh->prepare("select author.author_number, author_last,author_first, book_code, sequence_number
from author, wrote
where author.author_number = wrote.author_number"
$sth->execute();
$i=0;
while (@row = $sth->fetchrow_array()){
$storage[$i] = "@row";
$i++;
}
$dbh->disconnect();
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD><TITLE>Database Output</TITLE></HEAD>\n";
print "<BODY>\n";
foreach (@storage){
print $_ . "<br>\n";
}
print "</BODY>\n";
print "</HTML>\n";
I'm about to start reading CGI Programming; I thought I would try somthing first.
Thanks,
StickyBit.