in reply to Re^4: Perl CGI and SQL statements
in thread Perl CGI and SQL statements
I'm still getting this error:my $db = new Win32::ODBC('$DSN'); if (defined $dept) { if (exists $labels{$dept}) { # FIXME # untaint $dept and put it into database print $cgi->start_html, $cgi->p("$dept was received."); $cgi->end_html; if ($dept eq "CA") { if (!($db=new Win32::ODBC('$DSN'))) { $cgi->p("Error connecting to Database"); $cgi->p("Error: " . Win32::ODBC::Error ) . " "); } my $SqlStatement ='SELECT * FROM Pipeline WHERE Publish<="19 Apr 2006" + AND Expiry>="19 Apr 2006" AND CA="Must Read"'; print $SqlStatement; $db->Sql('$SqlStatement');
Line 51 is: $db->Sql('$SqlStatement'); It's like it won't substitute the contents $SqlStatement or something? Why is that?:\Perlcgi\Pipeline\cgi.pl: Can't call method "Sql" on an undefined val +ue at E:\Perlcgi\Pipeline\cgi.pl line 51.
Incidentally, if I drop in the SQL Statement in that Line 51 code it still gives the same error message. Does CGI need me to express the $db->Sql() differently?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Perl CGI and SQL statements
by osunderdog (Deacon) on Apr 19, 2006 at 13:44 UTC | |
|
Re^6: Perl CGI and SQL statements
by ptum (Priest) on Apr 19, 2006 at 13:33 UTC |