|
|
sybperl-l Archive
Up Prev Next
From: jrisley at nex-web4 dot corp dot fedex dot com (Jason Risley)
Subject: (no subject)
Date: Dec 9 1998 10:16PM
Given the code below, I am able to run the script from a command prompt and
ther data is printed normally. However, when I try and excute the script as
CGI from Apache 1.3.3 I only the get only the the following printed back to
the browser:
The DSN below is a local Access97 database. Does anybody have any
suggestions as to why the data is not returned to the browser?
Thanks
Jason
The Code I have is as follows:
#!C:/perl/5.00502/bin/mswin32-x86/perl.exe
$! = 1;
print "Content-type: text/html\n\n";
use DBI;
$DSN = 'CLS_GRID_DEV';
$user = '';
$passwd = '';
$dbh = DBI->connect('dbi:ODBC:$DSN', 'user', 'password');
print " ";
$sth=$dbh->prepare("SELECT status, [APTS Activity Number] from [APTS
Status] ") or die "Cannot SELECT from table";
$sth->execute or die "Cannot execute SELECT from table";
my($status, $activity);
$rv=$sth->bind_columns(undef, \$status, \$activity);
$rv=$sth->rows;
while ($sth->fetch) {
print "Activity Number: $activity Status: $status \n";
}
print "";
|