in reply to Re: CGI executing a SQL statement
in thread CGI executing a SQL statement
In after this statement in the CGI that I described above:$db = new Win32::ODBC("$DSN"), if ($dept ='CA'){ if (!($db=new Win32::ODBC($DSN))) { print "Error connecting to Database\n"; print "Error: " . Win32::ODBC::Error() . "\n"; } $SqlStatement = "SELECT * FROM Pipeline WHERE Publish<='$tod +ay' AND Expiry>='$today' AND CA='Must Read'"; if ($db->Sql($SqlStatement)) { print "SQL failed.\n <br>$SqlStatement\n"; print "Error: " . $db->Error() . "\n"; } else { while($db->FetchRow()) { %Data = $db->DataHash(); print "<li><a href=\"http://wwwybs/ybsone/Pipeline/master/ +$folderday/$Data{'Ref'}\" target=\"main\"><strong><font face=\"Arial\ +">$Data{'Title'}</a></font>Theme: $Data{'Theme'}</li>"; } } $db->Close(); }
I just get compilation errors and random messages about syntax errors. Why?$cgi->p("$dept was received."),
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: CGI executing a SQL statement
by Mr. Muskrat (Canon) on Apr 18, 2006 at 15:33 UTC | |
|
Re^3: CGI executing a SQL statement
by CountZero (Bishop) on Apr 18, 2006 at 19:58 UTC | |
|
Re^3: CGI executing a SQL statement
by Anonymous Monk on Apr 18, 2006 at 15:47 UTC |