in reply to Question about joins?

Do you have warnings turned on? If not, do so (put use warnings; at the top of your script). If so, does it tell you that you have an uninitialized value? That would mean that $AuthUser is not being captured.

Please, don't give up on DBI, if you are just starting with perl and SQL, it will save you much grief in the long run. If you're having problems installing it, post the problems here, we can help.

Replies are listed 'Best First'.
Re^2: Question about joins?
by zackdade (Initiate) on Jan 14, 2005 at 16:48 UTC
    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
      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! ;)