---------------------------- Original Message ----------------------------
Subject: Re: Please help: DBI Question
From:    "kbass" <[EMAIL PROTECTED]>
Date:    Sun, November 23, 2003 1:32
To:      "Colin Wetherbee" <[EMAIL PROTECTED]>
--------------------------------------------------------------------------


----- Original Message -----
From: "Colin Wetherbee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "kbass" <[EMAIL PROTECTED]>
Sent: Thursday, November 20, 2003 4:09 PM
Subject: Re: Please help: DBI Question


> kbass said:
> > I am receiving a variable from HTML called 'STerr' and reading it into
my
> > CGI program. The variable is accepted into the program and filters
down into a SQL statement. My problem is that I get no results from
within my CGI program but when I place this same SQL statement within
Postgres, I receive data back.
> [snip]
> > ##############################
> > # Procedure: View_Info       #
> > ##############################
> > sub View_Info {
> >
> >                $sql = "select fyear,
> >                        fqtr,
> >                        adjtype,
> >                        adjref,
> >                        subdist,
> >                        subdate,
> >                        adjgoalvolqty
> >               from fy04q1bulletin
> >                  where subdist = ?
> >                ";
> >
> >         $sth = $dbh->prepare($sql);
> > *       my $territory_quoted = $dbh->quote( $territory);
> > **      $sth->execute($territory_quoted);
> [snip]
>
> Usually, you want to use *either* $dbh->quote() *or*
> $sth->execute($param).  Using $sth->execute($param) automagically quotes
for you.  So, if I were you, I'd comment out the line I've marked with
the * and then replace the $territory_quoted with $territory in the line
I've marked with ** and try again.
>
> Colin
>
> --
> Colin W. Wetherbee
> http://hydrogen.denterprises.org/

Thanks for the response. I have found the problem.  The code was correct
but there was a problem (or bug) in the DBD::PgPP module.  I used the
DBD::Pg module and all problems got resolved. Thanks!

Kevin




-- 
Colin W. Wetherbee
http://hydrogen.denterprises.org/

Reply via email to