in reply to Re: Question about joins?
in thread Question about joins?

Thanks for the heads up :) I had printed out the $sqlst and it printed out with the $AuthUser variable included, but it's bizarre... I installed DBI and the DBD modules and whenever I try and run a script it always comes back with the "incomplete http headers" so then I try something different and nothing prints out, no error messages, etc.
I'm on a 2003 server box and if someone could post the proper DBI connect statements with variables (even an example) to MS SQL and a basic select statement I could take it from there.
I appreciate everyones help! :) Thanks - Zack

Replies are listed 'Best First'.
Re^3: Question about joins?
by jZed (Prior) on Jan 14, 2005 at 16:56 UTC
    Incomplete headers is a CGI problem, not a DBI problem. Try adding CGI::Carp as I show below so errors will print to the browser. Assuming you have created a *system* DSN for your database called MyDB, here's basic usage:
    #!perl -w use strict; use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; my $dbh = DBI->connect( 'dbi:ODBC:MyDB' , $user , $pass , {RaiseError=>1} ); my $sth = $dbh->prepare("SELECT * FROM foo"); $sth->execute; print CGI::header(); while (my $row = $sth->fetch){ my @r = map { defined $_ ? $_ : '' } @$row; print "@r<br>\n"; } $dbh->disconnect;
      thanks - I'll have to try that out! ;)