esolm has asked for the wisdom of the Perl Monks concerning the following question:
And This Works<html> <head> <title>test page</title> </head> <body> <h1>Hello World!!!</h1> </body> </html>
BUT THIS DOSEN'T - it is being called as http://localhost/scripts/dbtestonline.pl - I think it is failing at $CDS=DBI->connect... but I don't know why#!/usr/bin/perl # dbtest.pl use warnings; use strict; use DBI; my ($CDS, $UPDATE, $name, $type, $len, $sqlquery); $CDS=DBI->connect('DBI:ODBC:claudonntUPDATE', 'xxxx', 'xxxx') || die "error opening database: $DBI::errstr\n"; # sql query ******************************************* $sqlquery=$CDS->prepare(" SELECT catid, description, count (*) FROM cds_prod, cds_cctxx WHERE catid = id GROUP BY catid, description ORDER BY catid;") || die "Prepare failed: $DBI::errstr\n"; $sqlquery->execute() || die "couldn't execute query: $DBI::errstr\n"; while (($name, $type, $len) = $sqlquery->fetchrow_array) { print "$name","\t","$type", "\t","$len\n"; } $sqlquery ->finish(); $CDS->disconnect || die "failed to disconnect\n";
#!/usr/bin/perl # dbtest.pl use warnings; use strict; use DBI; print "Content-type: text/html\n\n"; my ($CDS, $UPDATE, $name, $type, $len, $sqlquery); print " <html> <head> <title>dbtest </title> </head> <body>"; $CDS=DBI->connect('DBI:ODBC:claudonntUPDATE', 'xxx', 'xxx') || die "error opening database: $DBI::errstr\n"; # sql query ******************************************* $sqlquery=$CDS->prepare(" SELECT catid, description, count (*) FROM cds_prod, cds_cctxx WHERE catid = id GROUP BY catid, description ORDER BY catid;") || die "Prepare failed: $DBI::errstr\n"; $sqlquery->execute() || die "couldn't execute query: $DBI::errstr\n"; print "<center><table Border=1>"; while (($name, $type, $len) = $sqlquery->fetchrow_array) { print "<tr><td>$name</td> <tr>$type</td> <tr>$len</td></tr>"; } print "</table></center></body><html>"; $sqlquery ->finish(); $CDS->disconnect || die "failed to disconnect\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl, IIS, and sql Server help
by sierrathedog04 (Hermit) on Mar 30, 2001 at 01:19 UTC | |
|
Re: perl, IIS, and sql Server help
by esolm (Acolyte) on Mar 30, 2001 at 00:33 UTC | |
|
Re: perl, IIS, and sql Server help
by how do i know if the string is regular expression (Initiate) on Mar 29, 2001 at 22:35 UTC | |
by esolm (Acolyte) on Mar 29, 2001 at 22:43 UTC | |
by how do i know if the string is regular expression (Initiate) on Mar 29, 2001 at 23:12 UTC |